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.180967 (sec), leaf count = 35

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

Maple
cpu = 0.137 (sec), leaf count = 35

\[\left [y \left (x \right ) = {\mathrm e}^{2 x} \textit {\_C2} +{\mathrm e}^{2 x} x \textit {\_C1} -\frac {\left (\cos ^{2}\left (x \right )-x^{2}-1\right ) {\mathrm e}^{2 x}}{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))

Maple raw output

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