Using Wronskian to solve nonhomegeneous ODE

I have the given ODE:

$$y''+2y'+2y=e^{-x}\sin x$$

This has the homogeneous solution $$y_h=C_1\cos(i-1)x+C_2\sin(-i-1)x$$.

The particular solution, in the form $$y_p=uy_1+vy_2$$, we seek the Ansatz: $$y_p=uy_1+vy_2=e^{-x}(\sin x+\cos x)$$. So $$y_1=e^{-x}\sin x$$ and $$y_2=e^{-x}\cos x$$

Then we aim to solve for $$u$$ and $$v$$ by use of the variation of parameters formula:

$$u'y_1+v'y_2=0$$ $$u'y_1'+v'y_2'=f(x)$$

where $$f(x)=e^{-x}\sin x$$.

So here I should use the Wronskian to facilitate the process. The Wronskian is naturally dependent on $$y_1$$ and $$y_2$$ and are $$y_1=e^{-x}\sin x$$ and $$y_2=e^{-x}\cos x$$.

So the Wronskian would be

$$$$\text{Det}\begin{vmatrix} e^{-x}\sin x & e^{-x}\cos x\\ e^{-x}\cos x-e^{-x}\sin x & -e^{-x}\cos x-e^{-x}\sin x \end{vmatrix}$$$$

My calculation gives:

$$Det=-e^{-2x}\cos2x$$

So how is this useful to solve the ODE, when I could just use the formula for variation of parameters?

Thanks

• You are applying the method of variation of parameters. The Wronskian is just the denominator in the Cramer solution formula of the linear system. Your matrix is wrong, you have the same function in the first row, and some sign errors in the second line. Oct 18, 2022 at 15:33
• There is still a sign error in the last entry, and the determinant should not have the second factor. Oct 18, 2022 at 17:02
• It just appears when you eliminate in the linear system. Remove $y_2$ to get $W·u'=-y_2·f$. Remove $y_1$ to get $W·v'=y_1·f$. Oct 18, 2022 at 17:11
• That is due to the still persisting sign error in $y_2'$. Oct 18, 2022 at 17:35
• Hint: $(\cos x)'=-\sin x$. Oct 18, 2022 at 17:53

$$y''+2y'+2y=0$$ The solution of the homogeneous should be: $$(r+1)^2-i^2=(r+1-i)(r+1+i)=0$$ $$y_h=e^{-x}(c_1\cos x+c_2\sin x)$$ Note that it's easier to first rewrite the DE as: $$y''+2y'+2y=e^{-x}\sin x$$ $$(ye^x)''+ye^x=\sin x$$ $$v''+v=\sin x$$ Then apply the method of variation of parameters.

• @Luthier415Hz : You don't. In constructing that form of the basis solutions / solution basis you have mixed some ideas that do not go well together. Oct 18, 2022 at 17:04
• The solution of the DE should use exponential $e^{(-1 \pm i)x}$ then use Euler's formula $e^{ix}=\cos x +i \sin x$ @Luthier415Hz Oct 18, 2022 at 17:05
• Ah! Thanks, now I see. Oct 18, 2022 at 17:09
• PS: I got $$y_h=C_2e^{-x-ix}+C_2e^{-x+ix}$$, $$C_1e^{-x}(\cos x-i\sin x)+C_2e^{-x}(\cos x+i\sin x)$$, $$C_1e^{-x}\cos x-C_1e^{-x}i\sin x+ C_2e^{-x}\cos x+C_2e^{-x}i\sin x$$, $$y_h=(C_2-C_1)e^{-x}i\sin x+(C_1+C_2)e^{-x}\cos x$$ Oct 18, 2022 at 17:19
• You can factorize $e^{-x}$ then $C_2-iC1=A$ is just a constant rename it @Luthier415Hz Oct 18, 2022 at 17:27

It is generally easier to solve linear ODE with constant coefficients this way:

• your homogeneous equation has root $$r$$ with multiplicity $$m$$ .
• the full equation has a RHS of the form $$P(x)e^{rx}$$ with $$P$$ polynomial.

Then you need to search for a particular solution in the form $$Q(x)e^{rx}$$ with $$Q$$ polynomial and $$\deg(Q)=\deg(P)+m$$

Although since the homogeneous solution will already have vanishing terms $$(C_0+C_1x+\cdots+C_{m-1}x^{m-1})e^{rx}$$, you can ignore them in the polynomial Q.

So here your homogeneous equation is $$y''+2y'+2y=0$$ of characteristic equation $$r^2+2r+2=0$$

It has roots $$r=-1\pm i$$ of multiplicity $$m=1$$.

The sinus can be rewritten as a combination of $$e^{ix}$$ and $$e^{-ix}$$, therefore you RHS is $$\underbrace{\frac 1{2i}}_{P_1}e^{-x+ix}-\underbrace{\frac 1{2i}}_{P_2}e^{-x-ix}$$

Both terms of your RHS collide with the roots of the characteristic equation so since $$P_1,\ P_2$$ are constant polynomials, you need to search for particular solutions of the form $$(ax+b)e^{-x+ix}$$ and $$(cx+d)e^{-x-ix}$$

(i.e. $$\deg(Q)=\deg(P)+m=0+1=1$$)

As said coefficients $$b$$ and $$d$$ can be ignored because we know already reporting in the ODE, the associated part will just vanish.

Therefore we can search for $$ax\,e^{-x+ix}+cx\,e^{-x-ix}$$ or directly in recomposed trig form $$\big(A\cos(x)+B\sin(x)\big)xe^{-x}$$

Solving gives $$A=-\frac 12$$ and $$B=0$$.

• It is Therefore we can search for $ax\,e^{-x+ix}+cx\,e^{-x-ix}$ or directly in recomposed trig form $$\big(A\cos(x)+B\sin(x)\big)xe^{-x}$$ that is completely new to me. How? Oct 18, 2022 at 17:08
• See this related post for a justification on an example. This is theory, you can have a look at my homepage question "how to solve linear equations", it is for sequences, but exactly the same theory for linear ODE.
– zwim
Oct 19, 2022 at 11:24