When a derivative can be written as a function of the independent variable only:
for example :
′
y
f(x)
​​
′′
y
f(x)
​​
′′′
y
f(x)
etc
We call that a directly integrable equation

Example 1:

Find the general solution for the following directly integrable equation
dy
dx
6
2
x
+4
That means
y∫6
2
x
+4dx
y2
3
x
+4x+c
,where
c
isanarbitrarysolution
So,
y2
3
x
+4x+c
is the general solution. It describes a family of functions that all satisfy the differential equation.
In[]:=
y'[x_]=6x^2+4
Out[]=
4+6
2
x
In[]:=
y[x_]=Integrate[y'[x],x,GeneratedParameters->C]
Out[]=
4x+2
3
x
+

1
​

Example 2:

Find the particular solution for the following equation with condition
2
x
′
y
-1
y(1)3
So we will need to get the
′
y
by itself
′
y
-
-1
x
then
y-
1
2
x
dx
so ,
y
1
x
+c
,where
c
isanarbitrarysolution
And this is our general solution. Now we plug in the initial condition when
x1,y3
That means
c2
Thus, the particular solution is
y
1
x
+2
In[]:=
Clear["Global`*"]
We can calculate the general solution as follows
In[]:=
y'[x]==-
1
x^2
;
In[]:=
y[x]=Integrate[y'[x],x,GeneratedParameters->C]
Out[]=
1
x
+

1
and the we calculate the particular solution using the initial condition
In[]:=
SimplifyDSolvey'[x]==-
1
x^2
,y[1]==3,y[x],x
Out[]=
y[x]2+
1
x

In[]:=
Plot[2+1/x,{x,-20,20},PlotRange->Automatic,AxesLabel->Automatic]
Out[]=

Example 3

Find the particular solution for the following equation with condition
2
d
y
d
2
t
cost,
′
y
(0)0, y(0)1
So the antiderivative is
dy
dt
sint+
c
1
the we use the initial condition
′
y
(0))0
andwehave
c0
So ,
dy
dt
sint
, then
y-cost+
c
2
Now, we plug in our initial condition
y(0)1
to our general solution and we get
c
2
2
Hence, the particular solution to our problem is
y-cost+2
In[]:=
Simplify[DSolve[{y''[t]==Cos[t],{y'[0]==0,y[0]==1}},y[t],t]]
Out[]=
{{y[t]2-Cos[t]}}
In[]:=
Plot[2-Cos[t],{t,-5,5},PlotRange->Automatic,AxesLabel->Automatic]
Out[]=