topic badge
New Zealand
Level 8 - NCEA Level 3

Solve DE's of the form dy/dx = g(y)



Certain first order differential equations can be expressed as $\frac{dy}{dx}=g(y)$dydx=g(y) where $g(y)$g(y) is some function of $y$y. Examples include $\frac{dy}{dx}=y$dydx=y$\frac{dy}{dx}=y^2$dydx=y2$\frac{dy}{dx}=2y-1$dydx=2y1, etc.

Recall that they are first order because the highest derivative that appears is the first derivative.

There are a number of ways to solve this type of equation. Perhaps the most direct way is to use the fact that the inverse of $dy/dx$dy/dx is, as expected, $dx/dy$dx/dy

We will demonstrate this direct method using  6 graded examples. Study these carefully!


Example 1

Solve   $\frac{dy}{dx}=y$dydx=y

Here we first note that $\frac{dx}{dy}=\frac{1}{y}$dxdy=1y and then proceed to integrate both sides with respect to $y$y


$\frac{dy}{dx}$dydx $=$= $y$y
$\frac{dx}{dy}$dxdy $=$= $\frac{1}{y}$1y
$\int\frac{dx}{dy}dy$dxdydy $=$= $\int\frac{1}{y}dy$1ydy
$\int dx$dx $=$= $\ln y+C$lny+C
$x-C$xC $=$= $\ln y$lny
$\therefore$  $y$y $=$= $e^{x-C}=e^x\times e^C=Ae^x$exC=ex×eC=Aex


Example 2

Solve the equation $y'+2y-1=0$y+2y1=0

Here we isolate $y'$y so that $y'=1-2y$y=12y, and then proceed as before:

$\frac{dy}{dx}$dydx $=$= $1-2y$12y
$\frac{dx}{dy}$dxdy $=$= $\frac{1}{1-2y}$112y
$\int\frac{dx}{dy}dy$dxdydy $=$= $\int\frac{1}{1-2y}dy$112ydy
$\int dx$dx $=$= $-\frac{1}{2}\int\frac{-2}{1-2y}dy$12212ydy
$x$x $=$= $-\frac{1}{2}\ln(1-2y)+C$12ln(12y)+C
$2(C-x)$2(Cx) $=$= $\ln(1-2y)$ln(12y)

From here, we have that:  

$1-2y$12y $=$= $e^{2C-2x}$e2C2x
  $=$= $e^{2C}\times e^{-2x}$e2C×e2x
  $=$= $Ae^{-2x}$Ae2x
$\therefore$  $2y$2y $=$= $1-Ae^{-2x}$1Ae2x
$y$y $=$= $\frac{1}{2}+Be^{-2x}$12+Be2x

Note that $e^{2C}$e2C is just a constant, and so we called it $A$A. Then, further down, $-A$A was divided by $2$2 to form another constant. We called it $+B$+B because we absorbed the negative sign into it.   

As a quick check note that if $y=\frac{1}{2}+Be^{-2x}$y=12+Be2x, then $Be^{-2x}=y-\frac{1}{2}$Be2x=y12, so that

$\frac{dy}{dx}$dydx $=$= $-2Be^{-2x}$2Be2x
  $=$= $-2[y-\frac{1}{2}]$2[y12]
  $=$= $1-2y$12y


Example 3

Solve the equation $\frac{dy}{dx}=1+y^2$dydx=1+y2

This is an interesting example made so by the presence of the constant 1 on the right hand side. Had it not been there the solution would have turned out to be  $y=\frac{1}{C-x}$y=1Cx. You might like to see if you can prove this yourself.

The constant $1$1 however sends us on a different path:

$\frac{dy}{dx}$dydx $=$= $1+y^2$1+y2
$\frac{dx}{dy}$dxdy $=$= $\frac{1}{1+y^2}$11+y2
$int\frac{dx}{dy}dy$intdxdydy $=$= $\int\frac{1}{1+y^2}dy$11+y2dy
$x$x $=$= $\tan^{-1}y+C$tan1y+C
$x-C$xC $=$= $\tan^{-1}y$tan1y
$\therefore$  $y$y $=$= $\tan(x-C)$tan(xC)

Checking our solution we have $\frac{dy}{dx}=\sec^2(x-C)=1+\tan^2(x-C)=1+y^2$dydx=sec2(xC)=1+tan2(xC)=1+y2.


Example 4

Solve the differential equation given by $y'-4y^2=1-4y$y4y2=14y.

Isolating $y'=\frac{dy}{dx}$y=dydx, we proceed as follows:

$\frac{dy}{dx}$dydx $=$= $4y^2-4y+1$4y24y+1
  $=$= $(2y-1)^2$(2y1)2
$\therefore$  $\frac{dx}{dy}$dxdy $=$= $\frac{1}{(2y-1)^2}$1(2y1)2
$\int dx$dx $=$= $\int(2y-1)^{-2}dy$(2y1)2dy
$x$x $=$= $\frac{(2y-1)^{-1}}{-2}+C$(2y1)12+C
$C-2x$C2x $=$= $\frac{1}{2y-1}$12y1

Hence $2y-1=\frac{1}{C-2x}$2y1=1C2x so $2y=1+\frac{1}{C-2x}$2y=1+1C2x and $y=\frac{1}{2}(1+\frac{1}{C-2x})$y=12(1+1C2x)


Example 5

Solve the equation $y'=e^y$y=ey with the boundary value $y(0)=-1$y(0)=1


$\frac{dy}{dx}$dydx $=$= $e^y$ey
$\frac{dx}{dy}$dxdy $=$= $e^{-y}$ey
$\int\frac{dx}{dy}dy$dxdydy $=$= $\int e^{-y}dy$eydy
$x$x $=$= $-e^{-y}+C$ey+C
$x-C$xC $=$= $-\frac{1}{e^y}$1ey
$\therefore$  $e^y$ey $=$= $\frac{1}{C-x}$1Cx

This means that $y=-\ln(C-x)$y=ln(Cx). From the boundary condition $y(0)=-1$y(0)=1, we have that $-1=-\ln C$1=lnC from which we find $C=e$C=e

Hence our specific solution becomes $y=-\ln(e-x)$y=ln(ex) and we can rearrange this to $y=\ln\frac{1}{e-x}$y=ln1ex. We can checking our solution by differentiating directly. 

Thus $\frac{dy}{dx}=\frac{1}{e-x}$dydx=1ex. The original form of the derivative given in the question was $\frac{dy}{dx}=e^y$dydx=ey but since we found that $y=\ln\frac{1}{e-x}$y=ln1ex, upon substituting, we find $\frac{dy}{dx}=e^{\ln\frac{1}{e-x}}=\frac{1}{e-x}$dydx=eln1ex=1ex


Example 6

Solve the equation given by $y'=\frac{y}{2}+\frac{3}{y}$y=y2+3y , $y>0$y>0 and with the boundary value $y(\ln7)=1$y(ln7)=1.

Before beginning, it sometimes is a good idea to simplify the right hand function $g(y)$g(y). By adding the two fractional parts together we see that $g(y)=\frac{y^2+6}{2y}$g(y)=y2+62y, and note that the derivative of the numerator is the denominator - a fact that will prove to be useful.

We begin as before:

$\frac{dy}{dx}$dydx $=$= $\frac{y^2+6}{2y}$y2+62y
$\frac{dx}{dy}$dxdy $=$= $\frac{2y}{y^2+6}$2yy2+6
$\int\frac{dx}{dy}dy$dxdydy $=$= $\int\frac{2y}{y^2+6}dy$2yy2+6dy
$x$x $=$= $\ln(y^2+6)+C$ln(y2+6)+C
$\therefore$  $y^2+6$y2+6 $=$= $e^{x-C}$exC
$y^2$y2 $=$= $e^{x-C}-6$exC6

We have to do a little work to evaluate the constant of integration. From the boundary value $y(\ln7)=1$y(ln7)=1, we have that:

$1^2$12 $=$= $e^{\ln7-C}-6$eln7C6
$1$1 $=$= $e^{\ln7}\times e^{-C}-6$eln7×eC6
$1$1 $=$= $7e^{-C}-6$7eC6
$7$7 $=$= $7e^{-C}$7eC
$\therefore$  $e^{-C}$eC $=$= $1$1
$\therefore$  $C$C $=$= $0$0

This means that $y^2=e^x-6$y2=ex6 and therefore, since $y>0$y>0, we have $y=\sqrt{e^x-6}$y=ex6

This can be easily checked.

We know now that $e^x=y^2+6$ex=y2+6 and so from $y=\sqrt{e^x-6}$y=ex6 we have:

$\frac{dy}{dx}$dydx $=$= $\frac{e^x}{2\sqrt{(e^x-6)}}$ex2(ex6)
  $=$= $\frac{y^2+6}{2\sqrt{y^2+6-6}}$y2+62y2+66
  $=$= $\frac{y^2+6}{\sqrt{y^2}}$y2+6y2
  $=$= $\frac{y^2+6}{2y}$y2+62y

The graph of the solution function $y=\sqrt{e^x-6}$y=ex6 is interesting.

The domain is naturally restricted to the open interval given by $x>\ln6$x>ln6, and an inflection is located at $(0,\ln12)$(0,ln12). Without drawing the graph, can you show mathematically that these two attributes of the curve are true?

Verify your findings by drawing the graph and locating the approximate position of the inflection.






Form differential equations and interpret the solutions


Apply integration methods in solving problems

What is Mathspace

About Mathspace