Internal
problem
ID
[17605]
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
:
Monday, March 31, 2025 at 04:22:15 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(-t+Pi)); ic:=y(0) = 0, D(y)(0) = 1; dsolve([ode,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)