Internal
problem
ID
[17322]
Book
:
Differential
equations.
An
introduction
to
modern
methods
and
applications.
James
Brannan,
William
E.
Boyce.
Third
edition.
Wiley
2015
Section
:
Chapter
2.
First
order
differential
equations.
Section
2.4
(Differences
between
linear
and
nonlinear
equations).
Problems
at
page
79
Problem
number
:
27
Date
solved
:
Monday, March 31, 2025 at 03:52:39 PM
CAS
classification
:
[[_linear, `class A`]]
With initial conditions
ode:=diff(y(t),t)+2*y(t) = piecewise(0 <= t and t <= 1,1,1 < t,0); ic:=y(0) = 0; dsolve([ode,ic],y(t), singsol=all);
ode=D[y[t],t]+2*y[t]==Piecewise[{{1,0<=t<=1},{0,t>1}}]; ic={y[0]==0}; DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
from sympy import * t = symbols("t") y = Function("y") ode = Eq(-Piecewise((1, (t >= 0) & (t <= 1)), (0, t > 1)) + 2*y(t) + Derivative(y(t), t),0) ics = {} dsolve(ode,func=y(t),ics=ics)