49.3.8 problem 8

Internal problem ID [7608]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 1. Introduction– Linear equations of First Order. Page 45
Problem number : 8
Date solved : Wednesday, March 05, 2025 at 04:47:51 AM
CAS classification : [[_linear, `class A`]]

\begin{align*} y^{\prime }+2 y&=b \left (x \right ) \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 20
ode:=diff(y(x),x)+2*y(x) = b(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (\int b \left (x \right ) {\mathrm e}^{2 x}d x +c_{1} \right ) {\mathrm e}^{-2 x} \]
Mathematica. Time used: 0.046 (sec). Leaf size: 31
ode=D[y[x],x]+2*y[x]==b[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to e^{-2 x} \left (\int _1^xe^{2 K[1]} b(K[1])dK[1]+c_1\right ) \]
Sympy. Time used: 1.044 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
b = Function("b") 
ode = Eq(-b(x) + 2*y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int b{\left (x \right )} e^{2 x}\, dx - \int \left (- 2 y{\left (x \right )} e^{2 x}\right )\, dx = C_{1} \]