26.7.30 problem Exercise 20, problem 31, page 220

Internal problem ID [7080]
Book : Ordinary Differential Equations, By Tenenbaum and Pollard. Dover, NY 1963
Section : Chapter 4. Higher order linear differential equations. Lesson 20. Constant coefficients
Problem number : Exercise 20, problem 31, page 220
Date solved : Tuesday, September 30, 2025 at 04:21:11 PM
CAS classification : [[_2nd_order, _quadrature]]

\begin{align*} y^{\prime \prime }&=0 \end{align*}

With initial conditions

\begin{align*} y \left (1\right )&=2 \\ y^{\prime }\left (1\right )&=-1 \\ \end{align*}
Maple. Time used: 0.021 (sec). Leaf size: 9
ode:=diff(diff(y(x),x),x) = 0; 
ic:=[y(1) = 2, D(y)(1) = -1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -x +3 \]
Mathematica. Time used: 0.003 (sec). Leaf size: 10
ode=D[y[x],{x,2}]==0; 
ic={y[1]==2,Derivative[1][y][1]==-1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to 3-x \end{align*}
Sympy. Time used: 0.023 (sec). Leaf size: 5
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), (x, 2)),0) 
ics = {y(1): 2, Subs(Derivative(y(x), x), x, 1): -1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = 3 - x \]