topic badge
New Zealand
Level 8 - NCEA Level 3

Solve DE's of the form dy/dx = f(x)


Certain first order differential equations can be expressible in the form $\frac{dy}{dx}=f(x)$dydx=f(x). In fact the solution to this type of differential equation is always given by $y=\int f(x)dx$y=f(x)dx.

Of course the differential equation might not be expressed so explicitly. The equations $y'-2x=0$y2x=0 and $x^2y'+5x-4=0$x2y+5x4=0 for example are equivalently $\frac{dy}{dx}=2x$dydx=2x and $\frac{dy}{dx}=\frac{4-5x}{x^2}$dydx=45xx2 respectively.

Whenever we integrate a function we produce a constant of integration, say $C$C. Thus, the general solution to the equation has the form $y=F(x)+C$y=F(x)+C where $F(x)$F(x) is the integral of $f(x)$f(x). If we have information that identifies a particular solution instance, say $(x_p,y_p)$(xp,yp), then by substitution $C$C can be determined as a specific value, say $C_p$Cp,  and hence a specific curve $y=F(x)+C_p$y=F(x)+Cp can be identified and drawn. 

We call this solution instance a boundary value and usually write $y(x_p)=y_p$y(xp)=yp.     

Here are five interesting examples to consider:

Example 1

Solve $\frac{dy}{dx}=\frac{7}{2\sqrt{x}}$dydx=72x with the boundary value given by $y(4)=15$y(4)=15

Our solution proceeds as:

$y$y $=$= $\int\frac{7}{2\sqrt{x}}dx$72xdx
  $=$= $\frac{7}{2}\int x^{-\frac{1}{2}}dx$72x12dx
  $=$= $\frac{7}{2}\times2x^{\frac{1}{2}}+C$72×2x12+C
$\therefore$  $y$y $=$= $7\sqrt{x}+C$7x+C

Noting the boundary value, we have that $15=7\sqrt{4}+C=14+C$15=74+C=14+C showing that $C=1$C=1, and so our particular solution becomes $y=7\sqrt{x}+1$y=7x+1


Example 2

Solve $y'=(x+2)e^{(x+2)^2}$y=(x+2)e(x+2)2 with $y(-2)=\frac{1}{2}$y(2)=12


$y$y $=$= $\int(x+2)e^{(x+2)^2}dx$(x+2)e(x+2)2dx
  $=$= $\frac{1}{2}\int2(x+2)e^{(x+2)^2}dx$122(x+2)e(x+2)2dx
  $=$= $\frac{1}{2}e^{(x+2)^2}+C$12e(x+2)2+C

From the given boundary value  we know that $\frac{1}{2}=\frac{1}{2}e^{(-2+2)^2}+C=\frac{1}{2}+C$12=12e(2+2)2+C=12+C and so clearly $C=0$C=0. This means that our particular solution becomes $y=\frac{1}{2}e^{(x+2)^2}$y=12e(x+2)2


Example 3

Solve the equation  $(x^2-x)\frac{dy}{dx}=3x-1$(x2x)dydx=3x1 with $y(2)=\ln2$y(2)=ln2.

Factorising and rearranging to an explicit form we find that $\frac{dy}{dx}=\frac{3x-1}{x(x-1)}$dydx=3x1x(x1). We can now use the theory of partial fractions to break the right hand fraction into two pieces. 

Setting $\frac{3x-1}{x(x-1)}=\frac{A}{x}+\frac{B}{x-1}$3x1x(x1)=Ax+Bx1 and multiplying through by $x(x-1)$x(x1) we have:


This is an identity, and therefore it is true for all values of $x$x.

If we put $x=1$x=1 we see that $B=2$B=2 and if we put $x=0$x=0 we see that $A=1$A=1.

This implies that $\frac{3x-1}{x(x-1)}=\frac{1}{x}+\frac{2}{x-1}$3x1x(x1)=1x+2x1.

Consequently we seek the solution to the differential equation given by $y'=\frac{1}{x}+\frac{2}{x-1}$y=1x+2x1

Hence we proceed as follows:

$y$y $=$= $\int\frac{1}{x}dx+2\int\frac{1}{x-1}dx$1xdx+21x1dx
  $=$= $\ln x+2\ln(x-1)+C$lnx+2ln(x1)+C
  $=$= $\ln[x(x-1)^2]+C$ln[x(x1)2]+C

With $y(2)=\ln2$y(2)=ln2 we have that $\ln2=\ln2\times1^2+C$ln2=ln2×12+C or that $\ln2=\ln2+C$ln2=ln2+C so that $C=0$C=0.

Hence our particular solution is given by $y=\ln[x(x-1)^2]$y=ln[x(x1)2]


Example 4

Solve the first order differential equation given by $(\cos^2x)y'=\sin x$(cos2x)y=sinx, with $y(0)=1$y(0)=1.

We first  rearrange so that:

$y'$y $=$= $\frac{\sin x}{\cos^2x}$sinxcos2x
  $=$= $\frac{\sin x}{\cos x}\times\sec x$sinxcosx×secx
$\therefore$  $y'$y $=$= $\sec x\tan x$secxtanx

We then look for a standard substitution to determine the integral. If we let $u=\sec x$u=secx then $\frac{du}{dx}=\sec x\tan x$dudx=secxtanx, and thus:

$y$y $=$= $\int\sec x\tan xdx$secxtanxdx
  $=$= $\int\frac{du}{dx}dx$dudxdx
  $=$= $\int du$du
  $=$= $u+C$u+C
$\therefore$  $y$y $=$= $\sec x+C$secx+C

From the boundary value $y(0)=1$y(0)=1, we have $1=\sec0+C$1=sec0+C or that $1=1+C$1=1+C, so $C=0$C=0. Hence the particular solution becomes $y=\sec x$y=secx.


Example 5 (extension)

Solve the differential equation given by $\frac{dy}{dx}=\frac{2x^2}{x^4-1}$dydx=2x2x41 with the boundary value given by $y(2)=\tan^{-1}2$y(2)=tan12.

This is an intriguing example because the presence of the $-1$1 in the denominator causes a few headaches with the integration. As an aside, if the constant $-1$1 was not there, the solution would be fairly straightforward. We would simply have $\frac{dy}{dx}=\frac{2x^2}{x^4}=\frac{2}{x^2}$dydx=2x2x4=2x2 and so our function $y$y would be given by $y=-\frac{2}{x}+C$y=2x+C

But the subtraction is there of course and so we have to deal with it. The solution pathway becomes quite complex to negotiate, and involves some understanding of partial fractions, logarithms and the inverse  trigonometric functions. 

We begin by recognising that $x^4-1=(x^2-1)(x^2+1)=(x-1)(x+1)(1+x^2)$x41=(x21)(x2+1)=(x1)(x+1)(1+x2)

Using partial fraction methods, we therefore can determine constants $A$A, $B$B, $C$C and $D$D such that:


Multiplying through by $x^4-1$x41 we see that:


This is an identity so it is true for all $x$x.

Putting $x=1$x=1 shows that $2=4A$2=4A so we know $A=\frac{1}{2}$A=12.

Putting $x=-1$x=1 similarly shows $2=-4B$2=4B so that $B=-\frac{1}{2}$B=12.

If we expand both sides we know that the constant terms on each side must be equal. By observation then, $0=A-B-D=\frac{1}{2}+\frac{1}{2}-D$0=ABD=12+12D, and hence $D=1$D=1.  

Finally, with $A$A,$B$B and $D$D known, one more substitution should allow us to find $C$C.

So choosing, say, $x=2$x=2 we have the equation $8=15A+5B+3(2C+D)=15\times\frac{1}{2}-5\times\frac{1}{2}+3(2C+1)$8=15A+5B+3(2C+D)=15×125×12+3(2C+1).

Simplifying we have $8=8+6C$8=8+6C, and so $C=0$C=0. Thus $A$A, $B$B, $C$C and $D$D are $\frac{1}{2}$12, $-\frac{1}{2}$12, $0$0 and $1$1.

Hence we have that $\frac{2x^2}{x^4-1}=\frac{\frac{1}{2}}{x-1}-\frac{\frac{1}{2}}{x+1}+\frac{1}{1+x^2}$2x2x41=12x112x+1+11+x2 and thus if $y'=\frac{\frac{1}{2}}{x-1}-\frac{\frac{1}{2}}{x+1}+\frac{1}{1+x^2}$y=12x112x+1+11+x2, then by integration we have:

$y$y $=$= $\frac{1}{2}\ln(x-1)-\frac{1}{2}\ln(x+1)+\tan^{-1}x+C$12ln(x1)12ln(x+1)+tan1x+C
  $=$= $\ln\sqrt{x-1}-\ln\sqrt{x+1}+\tan^{-1}x+C$lnx1lnx+1+tan1x+C

With  $y(2)=\tan^{-1}2$y(2)=tan12, we see that $\tan^{-1}2=0-\ln\sqrt{3}+\tan^{-1}2+C$tan12=0ln3+tan12+C .

Hence $C=\ln\sqrt{3}$C=ln3 and the final solution therefore becomes: 


As a final note on this question, we could have saved a considerable amount of time by noticing the following manipulation:

$\frac{2x^2}{x^4-1}$2x2x41 $=$= $\frac{(x^2+1)+(x^2-1)}{(x^2-1)(x^2+1)}$(x2+1)+(x21)(x21)(x2+1)
  $=$= $\frac{x^2+1}{(x^2+1)(x^2-1)}+\frac{x^2-1}{(x^2-1)(x^2+1)}$x2+1(x2+1)(x21)+x21(x21)(x2+1)
  $=$= $\frac{1}{x^2-1}+\frac{1}{x^2+1}$1x21+1x2+1
  $=$= $\frac{1}{(x-1)(x+1)}+\frac{1}{x^2+1}$1(x1)(x+1)+1x2+1

This means that only the first fraction would need to be broken into its partial fractions. It would however be hard to spot this shortcut in any case. 














Form differential equations and interpret the solutions


Apply integration methods in solving problems

What is Mathspace

About Mathspace