# differential equation - solving a second-order ODE with variable coefficients

I was analyzing stability for the following system of differential equations: $$z_1'=z_1+(6+e^{-t})z_2$$ $$z_2'=-z_1-4\tanh(t)z_2$$ In an effort to check my answer, I attempted to solve the system, but I'm not sure if this can even be accomplished. The following 2nd-order DE is what resulted when I differentiated the first equation above and made the appropriate substitutions: $$z_1''+\left(-1+\frac{e^{-t}}{6+e^{-t}}+\frac{4(6+e^{-t})\tanh(t)}{6+e^{-t}}\right)z_1'+\left(\frac{-e^{-t}}{6+e^{-t}}+6+e^{-t}-4\tanh(t)\right)z_1=0.$$ Is there a technique for solving this diff equ? Perhaps my more general question is do we have a strategy for solving 2nd-order linear DEs of the form $z_1''+a(t)z_1'+b(t)z_1=0$ ?

Thanks for your help.

http://eqworld.ipmnet.ru/en/solutions/sysode/sode-toc1.htm mentions the solving method of some special cases and general case of systems of linear first-order ODEs with functional coefficients. Note that the special cases mentioned in http://eqworld.ipmnet.ru/en/solutions/sysode/sode-toc1.htm are all having the simpler solving method than that the general case.

According to this question, unfortunately it is obviously only belongs to the general case (http://eqworld.ipmnet.ru/en/solutions/sysode/sode0107.pdf). So you should be unavoidable to handle some second-order linear ODEs with complicated functional coefficients.

$$z_1''=z_1'+(6+e^{-t})z_2'-e^{-t}z_2$$

$$z_1''=z_1'+(6+e^{-t})(-z_1-4\tanh(t)z_2)-e^{-t}z_2$$

$$z_1''=z_1'-(6+e^{-t})z_1-(e^{-t}+4(6+e^{-t})\tanh(t))z_2$$

$$z_1''=z_1'-(6+e^{-t})z_1-(e^{-t}+4(6+e^{-t})\tanh(t))\dfrac{z_1'-z_1}{6+e^{-t}}$$

$$z_1''=-\left(\dfrac{e^{-t}}{6+e^{-t}}-1+4\tanh(t)\right)z_1'+\left(\dfrac{e^{-t}}{6+e^{-t}}-6-e^{-t}+4\tanh(t)\right)z_1$$

$$z_1''+\left(\dfrac{e^{-t}}{6+e^{-t}}-1+4\tanh(t)\right)z_1'+\left(6+e^{-t}-\dfrac{e^{-t}}{6+e^{-t}}-4\tanh(t)\right)z_1=0$$

$$\dfrac{d^2z_1}{dt^2}+\left(-\dfrac{6}{6+e^{-t}}+\dfrac{4(1-e^{-2t})}{1+e^{-2t}}\right)\dfrac{dz_1}{dt}+\left(\dfrac{36+11e^{-t}+e^{-2t}}{6+e^{-t}}-\dfrac{4(1-e^{-2t})}{1+e^{-2t}}\right)z_1=0$$

$$\dfrac{d^2z_1}{dt^2}-\left(\dfrac{4e^{-2t}-4}{e^{-2t}+1}+\dfrac{6}{e^{-t}+6}\right)\dfrac{dz_1}{dt}+\left(\dfrac{4e^{-2t}-4}{e^{-2t}+1}+\dfrac{e^{-2t}+11e^{-t}+36}{e^{-t}+6}\right)z_1=0$$

Let $$u=e^{-t}$$ ,

Then $$\dfrac{dz_1}{dt}=\dfrac{dz_1}{du}\dfrac{du}{dt}=-e^{-t}\dfrac{dz_1}{du}=-u\dfrac{dz_1}{du}$$

$$\dfrac{d^2z_1}{dt^2}=\dfrac{d}{dt}\left(-u\dfrac{dz_1}{du}\right)=\dfrac{d}{du}\left(-u\dfrac{dz_1}{du}\right)\dfrac{du}{dt}=\left(-u\dfrac{d^2z_1}{du^2}-\dfrac{dz_1}{du}\right)(-u)=u^2\dfrac{d^2z_1}{du^2}+u\dfrac{dz_1}{du}$$

$$\therefore u^2\dfrac{d^2z_1}{du^2}+u\dfrac{dz_1}{du}+\left(\dfrac{4u^2-4}{u^2+1}+\dfrac{6}{u+6}\right)u\dfrac{dz_1}{du}+\left(\dfrac{4u^2-4}{u^2+1}+\dfrac{u^2+11u+36}{u+6}\right)z_1=0$$

$$\dfrac{d^2z_1}{du^2}+\dfrac{1}{u}\left(5-\dfrac{8}{u^2+1}+\dfrac{6}{u+6}\right)\dfrac{dz_1}{du}+\dfrac{1}{u^2}\left(4-\dfrac{8}{u^2+1}+\dfrac{u^2+11u+36}{u+6}\right)z_1=0$$

$$\dfrac{d^2z_1}{du^2}+\left(\dfrac{5}{u}-\dfrac{8}{u(u^2+1)}+\dfrac{6}{u(u+6)}\right)\dfrac{dz_1}{du}+\left(\dfrac{4}{u^2}-\dfrac{8}{u^2(u^2+1)}+\dfrac{u^2+11u+36}{u^2(u+6)}\right)z_1=0$$

$$\dfrac{d^2z_1}{du^2}+\left(\dfrac{8u}{u^2+1}-\dfrac{1}{u+6}-\dfrac{2}{u}\right)\dfrac{dz_1}{du}+\left(\dfrac{8}{u^2+1}+\dfrac{1}{6(u+6)}+\dfrac{5}{6u}+\dfrac{2}{u^2}\right)z_1=0$$

Let $$z_1=uz$$ ,

Then $$\dfrac{dz_1}{du}=u\dfrac{dz}{du}+z$$

$$\dfrac{d^2z_1}{du^2}=u\dfrac{d^2z}{du^2}+\dfrac{dz}{du}+\dfrac{dz}{du}=u\dfrac{d^2z}{du^2}+2\dfrac{dz}{du}$$

$$\therefore u\dfrac{d^2z}{du^2}+2\dfrac{dz}{du}+\left(\dfrac{8u}{u^2+1}-\dfrac{1}{u+6}-\dfrac{2}{u}\right)\left(u\dfrac{dz}{du}+z\right)+\left(\dfrac{8}{u^2+1}+\dfrac{1}{6(u+6)}+\dfrac{5}{6u}+\dfrac{2}{u^2}\right)uz=0$$

$$u\dfrac{d^2z}{du^2}+2\dfrac{dz}{du}+\left(\dfrac{8u^2}{u^2+1}-\dfrac{u}{u+6}-2\right)\dfrac{dz}{du}+\left(\dfrac{8u}{u^2+1}-\dfrac{1}{u+6}-\dfrac{2}{u}\right)z+\left(\dfrac{8u}{u^2+1}+\dfrac{u}{6(u+6)}+\dfrac{5}{6}+\dfrac{2}{u}\right)z=0$$

$$u\dfrac{d^2z}{du^2}+\left(\dfrac{8u^2}{u^2+1}-\dfrac{u}{u+6}\right)\dfrac{dz}{du}+\left(\dfrac{16u}{u^2+1}-\dfrac{2}{u+6}+1\right)z=0$$

$$\dfrac{d^2z}{du^2}+\left(\dfrac{8u}{u^2+1}-\dfrac{1}{u+6}\right)\dfrac{dz}{du}+\left(\dfrac{16}{u^2+1}-\dfrac{2}{u(u+6)}+\dfrac{1}{u}\right)z=0$$

$$\dfrac{d^2z}{du^2}+\left(\dfrac{8u}{u^2+1}-\dfrac{1}{u+6}\right)\dfrac{dz}{du}+\left(\dfrac{16}{u^2+1}+\dfrac{1}{3(u+6)}+\dfrac{2}{3u}\right)z=0$$