27.2 problem Ex 2

Internal problem ID [10250]

Book: An elementary treatise on differential equations by Abraham Cohen. DC heath publishers. 1906
Section: Chapter VII, Linear differential equations with constant coefficients. Article 50. Method of undetermined coefficients. Page 107
Problem number: Ex 2.
ODE order: 2.
ODE degree: 1.

CAS Maple gives this as type [[_2nd_order, _linear, _nonhomogeneous]]

Solve \begin {gather*} \boxed {y^{\prime \prime }-2 y^{\prime }+y-2 x \,{\mathrm e}^{2 x}+\sin ^{2}\relax (x )=0} \end {gather*}

Solution by Maple

Time used: 0.0 (sec). Leaf size: 38

dsolve(diff(y(x),x$2)-2*diff(y(x),x)+y(x)=2*x*exp(2*x)-sin(x)^2,y(x), singsol=all)
 

\[ y \relax (x ) = {\mathrm e}^{x} c_{2}+{\mathrm e}^{x} x c_{1}+\frac {\left (100 x -200\right ) {\mathrm e}^{2 x}}{50}-\frac {3 \cos \left (2 x \right )}{50}-\frac {2 \sin \left (2 x \right )}{25}-\frac {1}{2} \]

Solution by Mathematica

Time used: 0.18 (sec). Leaf size: 44

DSolve[y''[x]-2*y'[x]+y[x]==2*x*Exp[2*x]-Sin[x]^2,y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to -\frac {2}{25} \sin (2 x)-\frac {3}{50} \cos (2 x)+e^x \left (2 e^x (x-2)+c_2 x+c_1\right )-\frac {1}{2} \\ \end{align*}