2
$\begingroup$

I want to solve $$y''+\frac{x}{1-x}y'-\frac{1}{1-x}y=(x-1)e^{x}$$ using variation of parameters. Now, I could guess a solution to the inhomogeneous, i.e. $y_1 = x$. Then I used the formula of reduction of order $$y_2 = x\int\frac{e^{-\int \frac{x}{1-x}dx}}{x^2}dx =x\int \frac{e^{x+\ln(1-x)}}{x^2} = x\int\frac{(1-x)e^x}{x^2} = x\left[\int \frac{e^{x}}{x^2}-\int\frac{e^{x}}{x}\right] = x\left[-x^{-1}e^x+\int\frac{e^{x}}{x}-\int\frac{e^{x}}{x} \right] = -e^{x}$$ to find $y_2 =-e^x$.

However Mathematica says e solution is $y_2 = e^x$ so my question is:

Can I absorb the sign into the constant and take $y_2 =e^x$ ?

3 Answers 3

2

Yes, you can multiply a solution of the homogeneous equation by any constant (including $-1$) and get another solution of the homogeneous equation.

1

There was an error in the second step but it did not change the solution.

\begin{eqnarray} y_2 &=& x\int\frac{e^{-\int \frac{x}{1-x}dx}}{x^2}dx\\ &=&x\int \frac{e^{x+\ln(x-1)}}{x^2}\,dx\\ &=& x\int\frac{(x-1)e^x}{x^2}\,dx\\ &=&x\int\left(\frac{e^x}{x}\right)^\prime dx\\ &=& x\left(\frac{e^x}{x}\right)\\ &=&e^x \end{eqnarray}

But this is merely a multiple of $-e^x$ so the general solution for the homogeneous part is still

$$y_c=c_1x+c_2e^x$$

0

As the question has been answered, I am providing an alternative solution. Observe that $$\begin{align}\big(y''(x)-y'(x)\big)-\frac{1}{x-1}\,\big(y'(x)-y(x)\big)&=y''(x)-\frac{x}{x-1}\,y'(x)+\frac{1}{x-1}\,y(x) \\&=(x-1)\,\exp(x)\,. \end{align}$$ Thus, $$\frac{\text{d}}{\text{d}x}\,\left(\frac{y'(x)-y(x)}{x-1}\right)=\exp(x)\,.$$ This shows that $$y'(x)-y(x)=-a\,(x-1)+(x-1)\,\exp(x)\text{ for some constant }a\,.$$ As a result, $$\frac{\text{d}}{\text{d}x}\,\big(\exp(-x)\,y(x)\big)=-a\,(x-1)\,\exp(-x)+(x-1)\,.$$ In other words, there exists a constant $b$ for which $$y(x)=\exp(x)\Bigg(a\,x\,\exp(-x)+b+\frac{1}{2}\,(x-1)^2\Biggr)=a\,x+b\,\exp(x)+\frac{1}{2}\,(x-1)^2\,\exp(x)\,.$$


More generally, let the differential equation $$y''(x)+p(x)\,y'(x)+q(x)\,y(x)=r(x)$$ satisfy $k^2+k\,p+q=0$. Then, a homogeneous solution is $y(x)=\exp(k\,x)$. In fact, all homogeneous solutions are of the form $$y(x)=A\,\exp(k\,x)+B\,\exp(k\,x)\,\int\,\exp\big(-2\,k\,x-P(x)\big)\,\text{d}x\,,$$ where $P(x):=\displaystyle\int\,p(x)\,\text{d}x$. For the nonhomogeneous equation, a particular solution is $$y(x)=\exp(k\,x)\,\int\,\exp\big(-2\,k\,x-P(x)\big)\,R(x)\,\text{d}x\,,$$ where $R(x):=\displaystyle\int\,\exp\big(k\,x+P(x)\big)\,r(x)\,\text{d}x$.

Notice that $k=1$ works with $p(x):=-\dfrac{x}{x-1}$ and $q(x):=\dfrac{1}{x-1}$. Here, $P(x)=-x-\ln(x-1)$ (for an appropriate integral constant). For $r(x):=(x-1)\,\exp(x)$, we get that $R(x)=\exp(x)$ (for a good integral constant). Continuing from here yields a similar result, as before.