Example 1: Solve a simple separable differential equation
Solve
\[
\frac{dy}{dx}=3x.
\]
Solution
This is already separated, so integrate both sides:
\[
dy=3x\,dx
\]
\[
\int dy=\int 3x\,dx
\]
\[
y=\frac{3}{2}x^2+c.
\]
The general solution is
\[
y=\frac{3}{2}x^2+c.
\]
Example 2: Separate the variables and solve
Solve
\[
\frac{dy}{dx}=xy.
\]
Solution
Rearrange so that all \( y \)-terms are on one side:
\[
\frac{1}{y}\frac{dy}{dx}=x
\]
\[
\frac{1}{y}\,dy=x\,dx.
\]
Integrate both sides:
\[
\int \frac{1}{y}\,dy=\int x\,dx
\]
\[
\ln|y|=\frac{1}{2}x^2+c.
\]
The general solution is
\[
\ln|y|=\frac{1}{2}x^2+c.
\]
Example 3: Solve and use an initial condition
Solve
\[
\frac{dy}{dx}=2xy
\]
given that \( y=3 \) when \( x=0 \).
Solution
Separate the variables:
\[
\frac{1}{y}\,dy=2x\,dx.
\]
Integrate:
\[
\int \frac{1}{y}\,dy=\int 2x\,dx
\]
\[
\ln|y|=x^2+c.
\]
Use the condition \( y=3 \) when \( x=0 \):
\[
\ln 3=0+c
\]
\[
c=\ln 3.
\]
So
\[
\ln|y|=x^2+\ln 3.
\]
Now make \( y \) the subject:
\[
|y|=e^{x^2+\ln 3}=3e^{x^2}.
\]
Since \( y=3 \) when \( x=0 \), \( y \) is positive here, so
\[
y=3e^{x^2}.
\]
The particular solution is
\[
y=3e^{x^2}.
\]
Example 4: Solve with a negative power of \( y \)
Solve
\[
\frac{dy}{dx}=\frac{x}{y^2}.
\]
Solution
Separate the variables:
\[
y^2\,dy=x\,dx.
\]
Integrate both sides:
\[
\int y^2\,dy=\int x\,dx
\]
\[
\frac{1}{3}y^3=\frac{1}{2}x^2+c.
\]
Multiply through by \( 6 \) if a simpler form is wanted:
\[
2y^3=3x^2+c.
\]
A correct general solution is
\[
\frac{1}{3}y^3=\frac{1}{2}x^2+c.
\]
Example 5: Solve using exponential integration
Solve
\[
\frac{dy}{dx}=e^x y
\]
given that \( y=2 \) when \( x=0 \).
Solution
Separate the variables:
\[
\frac{1}{y}\,dy=e^x\,dx.
\]
Integrate:
\[
\int \frac{1}{y}\,dy=\int e^x\,dx
\]
\[
\ln|y|=e^x+c.
\]
Use \( y=2 \) when \( x=0 \):
\[
\ln 2=e^0+c=1+c
\]
\[
c=\ln 2-1.
\]
So
\[
\ln|y|=e^x+\ln 2-1.
\]
Exponentiate:
\[
y=e^{e^x+\ln 2-1}
\]
\[
y=2e^{e^x-1}.
\]
The particular solution is
\[
y=2e^{e^x-1}.
\]