[Math] Sine and cosine solutions of a differential equation

complex numbersordinary differential equationstrigonometry

I have to solve a differential equation with constant coefficient such as$$ay'''+by''+cy'+dy=f(x)$$ which has for a characteristic equation$$P_c(\lambda)=a\lambda^3+b\lambda^2+c\lambda+d=0$$First I have to find the homogeneous solution which is not a problem. Then, $f(x)$ is equal to a term of the form $e^{rx}$. The inhomogeneous solution is equal to $$x^me^{rx}$$ where $m$ is the multiplicity of $r$ as a root of $P_c(\lambda)$. My problem is that I am given $$f(x)=e^{\alpha x} cos(\beta x)$$I have to rewrite this term as the exponential of a complex number but I don't know how to figure it out. I thought I could write it like $e^{x(\alpha +i\beta)}$, but $e^{x(\alpha +i\beta)}=e^{\alpha x}(cos(\beta x)+i*sin(\beta x))$, and there is no sine in the inhomogeneous term. Could you help me rewrite the inhomogeneous term $f(x)$ so I can apply the basic rule as for the real roots of $P_c(\lambda)$?

Best Answer

Start with $$f(x)=e^{\alpha x}\cos\beta x=e^{\alpha x}\cdot\frac12\left(e^{i\beta x}+e^{-i\beta x}\right)=\frac12\left(e^{x(\alpha+i\beta)}+e^{x(\alpha-i\beta)}\right)$$ Then $$y_p(x)=c_1xe^{x(\alpha+i\beta)}+c_2xe^{x(\alpha-i\beta)}=(c_1+c_2)xe^{\alpha x}\cos\beta x+i(c_1-c_2)xe^{\alpha x}\sin\beta x$$ This is in terms of the complex constants $c_1$ and $c_2$. Since we ordinarily want the solution to be real, we have $$c_1+c_2=\Re c_1+\Re c_2+i\left(\Im c_1+\Im c_2\right)$$ So $\Im c_2=-\Im c_1$. Also $$i(c_1-c_2)=i\left(\Re c_1-\Re c_2\right)-\left(\Im c_1-\Im c_2\right)$$ So $\Re c_2=\Re c_1$ and that adds up to $c_2=c_1^*$. So two approaches to finding $y_p(x)$ that both work are to use exclusively real functions $$y_p(x)=c_3e^{\alpha x}\cos\beta x+c_4e^{\alpha x}\sin\beta x$$ With real $c_3$ and $c_4$ and differentiate $3\times$ and substitute into the differential equation or to change the differential equation into the complex form $$ay^{\prime\prime\prime}+by^{\prime\prime}+cy^{\prime}+dy=e^{x(\alpha+i\beta)}$$ And use $$y_p(x)=c_1e^{x(\alpha+i\beta)}$$ And solve for $c_1$. At the end you need $$\Re y_p(x)=\Re c_1e^{\alpha x}\cos\beta x-\Im c_1e^{\alpha x}\sin\beta x$$ Had you started with $f(x)=e^{\alpha x}\sin\beta x$ you would have taken $$\Im y_p(x)=\Im c_1e^{\alpha x}\cos\beta x+\Re c_1e^{\alpha x}\sin\beta x$$ The complex way only involves one constant but it requires complex arithmetic. Often it can be simpler than working with two real functions.