1

I'm asked to solve the following ODE:

$y^{(4)}-2y^{(3)}+5y^{(2)}=0$

I solve as usual, and got
$$c_1+c_2x+e^x(c_3cos(2x)+c_4sin(2x))$$

But in the solution and in WolframAlpha, they have:

$$c_1+c_2x+\frac{1}{25}(c_3(4cos(2x)+3sin(2x))+c_4(3cos(2x)-4sin(2x)))e^x$$

I don't see where this $\frac{1}{25}$ and those 3 and 4 come from. I thought that 25 is maybe the norm squared of $3cos(2x)-4sin(2x)$ but then, why do we have to normalize and where do the 3 and 4 as coefficients come from ? I thought that it's maybe because there are two sines and cosines and thus they are from the same family, but in this case, shouldn't we multiply by x instead of just a number ? Because in this case, they remain in the same family ($3cos(2x)$ and $4cos(2x)$ still belong to the same family)

Thanks for your help.

  • 3
    I'm not very familiar how wolfram alpha solves ode's. My explanation for that is if we let $u(x)=y''(x)$, then $u''(x)-2y'(x)+5u(x)=0$ has the solution $c_3e^x\cos(2x)+c_4e^x\sin (2x)$ which is $y''(x)$. I guess wolfram alpha searches now for the antiderivatives $y'(x)$ and $y(x)$. – Fakemistake Dec 02 '18 at 15:56
  • Okay, I checked and it seems to be that. Thanks a lot ! Just one question left: is what I did wrong or still correct ? Because I don’t see why it should be wrong given that I followed the “traditional” steps and the solution is almost the same, the only differences are numerical values. –  Dec 02 '18 at 16:25
  • 1
    For the sake of correctness, the differential equation in my comment above after letting $u(x)=y''(x)$ is $u''(x)-2u'(x)+5u(x)=0$. – Fakemistake Dec 02 '18 at 19:01

1 Answers1

2

Ultimately, it should be clear that they are equivalent. Let me rewrite yours as $$y=a_1+a_2x+e^x\bigl(a_3\cos(2x)+a_4\sin(2x)\bigr).$$ Setting $c_1=a_1,$ $c_2=a_2,$ $c_3=4a_3+3a_4,$ and $c_4=3a_3-4a_4,$ we then have $$y=c_1+c_2x+\frac1{25}\Bigl(c_3\bigl(4\cos(2x)+3\sin(2x)\bigr)+c_4\bigl(3\cos(2x)-4\sin(2x)\bigr)\Bigr)e^x.$$ On the other hand, starting with WA's solution, we set $a_1=c_1,$ $a_2=c_2,$ $a_3=\frac{4c_3+3c_4}{25},$ and $a_4=\frac{3c_3-4c_4}{25},$ yielding your solution.


I can't say for sure how WA obtained that solution or why they left it as they did, but here's an idea of an approach similar to that which it may have taken. Consider the ODE $$z''-2z'+5z=0\tag{$\star$}.$$ If $z(x)$ is a solution to $(\star),$ then any $y(x)$ satisfying $y''=z$ will satisfy the given ODE. On the other hand, if $y(x)$ is a solution to the given ODE, then $z=y''$ will be a solution to $(\star).$ Thus, it may be that WA began by considering $(\star),$ instead. The characteristic equation of $(\star)$ is $$\lambda^2-2\lambda+5=0,$$ which readily has solutions $\lambda=1\pm2i.$ Thus, the general solution to $(\star)$ is of one of the following equivalent forms: $$z(x)=b_1e^{(1+2i)x}+b_2e^{(1-2i)x}\\ z(x)=b_1e^{x+2xi}+b_2e^{x-2xi}\\ z(x)=\left(b_1e^{2xi}+b_2e^{-2xi}\right)e^x\\ z(x)=\left(b_1\bigl(\cos(2x)+i\sin(2x)\bigr)+b_2\bigl(\cos(2x)-i\sin(2x)\bigr)\right)e^x\\ z(x)=\left(\bigl(b_1+b_2)\cos(2x)+(b_1-b_2)i\sin(2x)\right)e^x.$$ There's no real reason to leave it this way, of course, so at this point, WA may have replaced it with $$z(x)=\bigl(c\cos(2x)+d\sin(2x))e^x,$$ or may have simply skipped right to this form.

At this point, having found $z(x),$ it may have found the general antiderivative (which would correspond to $y'$), then found the general antiderivative yet again. As I discuss in this answer, iterated integration by parts gives us the general formula $$\int e^{ax}\sin(bx)\,dx=e^{ax}\left(\frac{a}{a^2+b^2}\sin(bx)-\frac{b}{a^2+b^2}\cos(bx)\right)+C.$$ A similar approach yields $$\int e^{ax}\cos(bx)\,dx=e^{ax}\left(\frac{a}{a^2+b^2}\cos(bx)+\frac{b}{a^2+b^2}\sin(bx)\right)+C.$$ In our particular case, this means that $$\int e^x\cos(2x)\,dx=e^x\left(\frac15\cos(2x)+\frac25\sin(2x)\right)+C=\frac15\left(\cos(2x)+2\sin(2x)\right)e^x+C,$$ and similarly, $$\int e^x\sin(2x)\,dx=\frac15\left(\sin(2x)-2\cos(2x)\right)e^x+C.$$

Thus, $$y'(x)=\frac15\Bigl(c\bigl(\cos(2x)+2\sin(2x)\bigr)+d\cdot\bigl(\sin(2x)-2\cos(2x)\bigr)\Bigr)e^x+c_2,$$ or $$y'(x)=\frac15\Bigl((c-2d\bigr)\cos(2x)+\bigl(2c+d\bigr)\sin(2x)\Bigr)e^x+c_2.$$ Repeating this process again yields $$y(x)=\frac1{25}\Bigl(\bigl(c-2d\bigr)\bigl(\cos(2x)+2\sin(2x)\bigr)+\bigl(2c+d\bigr)\cdot\bigl(\sin(2x)-2\cos(2x)\bigr)\Bigr)e^x+c_2x+c_1,$$ or $$y(x)=c_1+c_2x+\frac1{25}\Bigl(c\bigl(4\sin(2x)-3\cos(2x)\bigr)-d\bigl(4\cos(2x)+3\sin(2x)\bigr)\Bigr)e^x.$$ At this point, we can let $c_3=-d$ and $c_4=-c,$ whence $$y(x)=c_1+c_2x+\frac1{25}\Bigl(c_3\bigl(4\cos(2x)+3\sin(2x)\bigr)+c_4\bigl(3\cos(2x)-4\sin(2x)\bigr)\Bigr)e^x.$$ I can't really see any reason for this final substitution, though, so I suspect WA didn't go about it in exactly this way.

Cameron Buie
  • 102,994