69.1.114 problem 162

Internal problem ID [14188]
Book : DIFFERENTIAL and INTEGRAL CALCULUS. VOL I. by N. PISKUNOV. MIR PUBLISHERS, Moscow 1969.
Section : Chapter 8. Differential equations. Exercises page 595
Problem number : 162
Date solved : Wednesday, March 05, 2025 at 10:39:12 PM
CAS classification : [[_2nd_order, _missing_x]]

\begin{align*} y^{\prime \prime }+2 h y^{\prime }+n^{2} y&=0 \end{align*}

With initial conditions

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

Maple. Time used: 0.154 (sec). Leaf size: 93
ode:=diff(diff(y(x),x),x)+2*h*diff(y(x),x)+n^2*y(x) = 0; 
ic:=y(0) = a, D(y)(0) = c; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {\left (\sqrt {h^{2}-n^{2}}\, a +a h +c \right ) {\mathrm e}^{\left (-h +\sqrt {h^{2}-n^{2}}\right ) x}-{\mathrm e}^{-\left (h +\sqrt {h^{2}-n^{2}}\right ) x} \left (-\sqrt {h^{2}-n^{2}}\, a +a h +c \right )}{2 \sqrt {h^{2}-n^{2}}} \]
Mathematica. Time used: 0.036 (sec). Leaf size: 123
ode=D[y[x],{x,2}]+2*h*D[y[x],x]+n^2*y[x]==0; 
ic={y[0]==a,Derivative[1][y][0] ==c}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^{-\left (x \left (\sqrt {h^2-n^2}+h\right )\right )} \left (a h \left (e^{2 x \sqrt {h^2-n^2}}-1\right )+a \sqrt {h^2-n^2} \left (e^{2 x \sqrt {h^2-n^2}}+1\right )+c \left (e^{2 x \sqrt {h^2-n^2}}-1\right )\right )}{2 \sqrt {h^2-n^2}} \]
Sympy. Time used: 0.264 (sec). Leaf size: 97
from sympy import * 
x = symbols("x") 
h = symbols("h") 
n = symbols("n") 
y = Function("y") 
ode = Eq(2*h*Derivative(y(x), x) + n**2*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {y(0): a, Subs(Derivative(y(x), x), x, 0): c} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (- \frac {a h}{2 \sqrt {h^{2} - n^{2}}} + \frac {a}{2} - \frac {c}{2 \sqrt {h^{2} - n^{2}}}\right ) e^{- x \left (h + \sqrt {h^{2} - n^{2}}\right )} + \left (\frac {a h}{2 \sqrt {h^{2} - n^{2}}} + \frac {a}{2} + \frac {c}{2 \sqrt {h^{2} - n^{2}}}\right ) e^{x \left (- h + \sqrt {h^{2} - n^{2}}\right )} \]