4.26.7 \(y''(x)-4 y'(x)+4 y(x)=e^{2 x} \cos ^2(x)\)

ODE
\[ y''(x)-4 y'(x)+4 y(x)=e^{2 x} \cos ^2(x) \] ODE Classification

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.0169225 (sec), leaf count = 35

\[\left \{\left \{y(x)\to \frac {1}{8} e^{2 x} \left (8 c_2 x+8 c_1+2 x^2-\cos (2 x)\right )\right \}\right \}\]

Maple
cpu = 0.026 (sec), leaf count = 28

\[ \left \{ y \left ( x \right ) =-{\frac {{{\rm e}^{2\,x}} \left ( \left ( \cos \left ( x \right ) \right ) ^{2}-4\,{\it \_C1}\,x-{x}^{2}-4\,{\it \_C2}-1 \right ) }{4}} \right \} \] Mathematica raw input

DSolve[4*y[x] - 4*y'[x] + y''[x] == E^(2*x)*Cos[x]^2,y[x],x]

Mathematica raw output

{{y[x] -> (E^(2*x)*(2*x^2 + 8*C[1] + 8*x*C[2] - Cos[2*x]))/8}}

Maple raw input

dsolve(diff(diff(y(x),x),x)-4*diff(y(x),x)+4*y(x) = exp(2*x)*cos(x)^2, y(x),'implicit')

Maple raw output

y(x) = -1/4*exp(2*x)*(cos(x)^2-4*_C1*x-x^2-4*_C2-1)