69.17.29 problem 579

Internal problem ID [18365]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Chapter 2 (Higher order ODEs). Section 15.3 Nonhomogeneous linear equations with constant coefficients. Superposition principle. Exercises page 137
Problem number : 579
Date solved : Thursday, October 02, 2025 at 03:10:58 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-4 y^{\prime }+4 y&=4 x +\sin \left (x \right )+\sin \left (2 x \right ) \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 31
ode:=diff(diff(y(x),x),x)-4*diff(y(x),x)+4*y(x) = 4*x+sin(x)+sin(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = 1+\left (c_1 x +c_2 \right ) {\mathrm e}^{2 x}+x +\frac {4 \cos \left (x \right )}{25}+\frac {3 \sin \left (x \right )}{25}+\frac {\cos \left (2 x \right )}{8} \]
Mathematica. Time used: 0.103 (sec). Leaf size: 77
ode=D[y[x],{x,2}]-4*D[y[x],x]+4*y[x]==4*x+Sin[x]+Sin[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{2 x} \left (\int _1^x-e^{-2 K[1]} K[1] (4 K[1]+\sin (K[1])+\sin (2 K[1]))dK[1]+x \int _1^xe^{-2 K[2]} (4 K[2]+\sin (K[2])+\sin (2 K[2]))dK[2]+c_2 x+c_1\right ) \end{align*}
Sympy. Time used: 0.163 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*x + 4*y(x) - sin(x) - sin(2*x) - 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x + \left (C_{1} + C_{2} x\right ) e^{2 x} + \frac {3 \sin {\left (x \right )}}{25} + \frac {4 \cos {\left (x \right )}}{25} + \frac {\cos {\left (2 x \right )}}{8} + 1 \]