Internal
problem
ID
[18962]
Book
:
Differential
equations.
An
introduction
to
modern
methods
and
applications.
James
Brannan,
William
E.
Boyce.
Third
edition.
Wiley
2015
Section
:
Chapter
4.
Second
order
linear
equations.
Section
4.5
(Nonhomogeneous
Equations,
Method
of
Undetermined
Coefficients).
Problems
at
page
260
Problem
number
:
37
Date
solved
:
Thursday, October 02, 2025 at 03:36:21 PM
CAS
classification
:
[[_2nd_order, _linear, _nonhomogeneous]]
With initial conditions
ode:=diff(diff(y(t),t),t)+y(t) = piecewise(0 <= t and t <= Pi,t,Pi < t,Pi*exp(Pi-t)); ic:=[y(0) = 0, D(y)(0) = 1]; dsolve([ode,op(ic)],y(t), singsol=all);
ode=D[y[t],{t,2}]+y[t]==Piecewise[{ {t,0<=t<=Pi}, {Pi*Exp[Pi-t],t>Pi} }]; ic={y[0]==0,Derivative[1][y][0] == 1}; DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
from sympy import * t = symbols("t") y = Function("y") ode = Eq(-Piecewise((2, (t >= 0) & (t <= pi)), (pi*exp(pi - t), t > pi)) + y(t) + Derivative(y(t), (t, 2)),0) ics = {} dsolve(ode,func=y(t),ics=ics)