69.1.115 problem 163

Internal problem ID [14268]
Book : DIFFERENTIAL and INTEGRAL CALCULUS. VOL I. by N. PISKUNOV. MIR PUBLISHERS, Moscow 1969.
Section : Chapter 8. Differential equations. Exercises page 595
Problem number : 163
Date solved : Tuesday, January 28, 2025 at 06:25:02 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+n^{2} y&=h \sin \left (r x \right ) \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=a\\ y^{\prime }\left (0\right )&=c \end{align*}

Solution by Maple

Time used: 0.056 (sec). Leaf size: 61

dsolve([diff(y(x),x$2)+n^2*y(x)=h*sin(r*x),y(0) = a, D(y)(0) = c],y(x), singsol=all)
 
\[ y = -\frac {\left (-c \,n^{2}+c \,r^{2}+h r \right ) \sin \left (n x \right )}{n^{3}-n \,r^{2}}+\cos \left (n x \right ) a +\frac {h \sin \left (r x \right )}{n^{2}-r^{2}} \]

Solution by Mathematica

Time used: 0.029 (sec). Leaf size: 63

DSolve[{D[y[x],{x,2}]+n^2*y[x]==h*Sin[r*x],{y[0]==a,Derivative[1][y][0] ==c}},y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to \frac {a n \left (n^2-r^2\right ) \cos (n x)+\sin (n x) \left (c n^2-c r^2-h r\right )+h n \sin (r x)}{n^3-n r^2} \]