You are on page 1of 173

Calculus

The word Calculus comes from Latin meaning "small stone",


Because it is like understanding something by looking at small
pieces.

Differential Calculus cuts something into small pieces to find


how it changes.

Integral Calculus joins (integrates) the small pieces together


to find how much there is.

Read Introduction to Calculus or "how fast right now?"

Limits
Limits are all about approaching. Sometimes you can't work something out directly, but
you can see what it should be as you get closer and closer!

Introduction to Limits

Limits and Infinity

Evaluating Limits
Limits (Formal Definition)

Continuous Functions

Derivatives (Differential Calculus)


The Derivative is the "rate of change" or slope of a function.

Introduction to Derivatives

Slope of a Function at a Point (Interactive)

Derivatives as dy/dx

Derivative Plotter

Derivative Rules

Second Derivative

Partial Derivatives

Differentiable

Finding Maxima and Minima using Derivatives

Concave Upwards and Downwards and Inflection Points

Implicit Differentiation

Taylor Series (uses derivatives)


Integration (Integral Calculus)
Integration can be used to find areas, volumes, central points and many useful things.

Introduction to Integration

Integration Rules

Integration by Parts

Integration by Substitution

Definite Integrals

Arc Length

Integral Approximations

Solids of Revolution by Disks and Washers

Differential Equations
In our world things change, and describing how they change often ends up as a Differential
Equation: an equation with a function and one or more of its derivatives:

Introduction to Differential Equations

Separation of Variables

Solution of First Order Linear Differential Equations


Homogeneous Differential Equations

Introduction to Calculus
Calculus is all about changes.

Sam and Alex are traveling in the car ... but the speedometer is broken.

Alex: "Hey Sam! How fast are we going now?"

Sam: "Wait a minute ..."

"Well in the last minute we went 1.2 km, so we are going:"

1.2 km per minute x 60 minutes in an hour = 72 km/h

"No, Sam! Not our average for the last minute, or even the last second, I want to know
Alex: our speed RIGHT NOW."

Sam: "OK, let us measure it up here ... at this road sign... NOW!"

"OK, we were AT the sign for zero seconds, and the distance was ... zero meters!"

The speed is 0m / 0s = 0/0 = I Don't Know!


"I can't calculate it Sam! I need to know some distance over some time, and you are
saying the time should be zero? Can't be done."

That is pretty amazing ... you'd think it is easy to work out the speed of a car at any point in
time, but it isn't.

Even the speedometer of a car just shows us an average of how fast we were going for the last
(very short) amount of time.

How About Getting Real Close


But our story is not finished yet!

Sam and Alex get out of the car, because they have arrived on location. Sam is about to do a
stunt:

Sam will do a jump off a 20 m building.

Alex, as photographer, asks:

"How fast will you be falling after 1 second?"

Sam uses this simplified formula to find the distance fallen:

d = 5t2

d = distance fallen, in meters


t = time from jump, in seconds

(Note: the formula is a simpler version of how fast things fall under gravity : d = gt2)

Example: at 1 second Sam has fallen

d = 5t2 = 5 12 = 5 m

But how fast is that? Speed is distance over time:


distance
Speed =
time

So at 1 second:

5m
Speed = = 5 m/s
1 second

"BUT", says Alex, "again that is an average speed, since you started the jump, ... I want to
know the speed at exactly 1 second, so I can set up the camera properly."

Well ... at exactly 1 second the speed is:

55m 0m
Speed = = = ????
11s 0s

So again Sam has a problem.

Think about it ... how do we figure out a speed at an exact instant in time?

What is the distance? What is the time difference?

They are both zero, giving us nothing to calculate with!

But Sam has an idea ... invent a time so short it won't matter.

Sam won't even give it a value, and will just call it "t" (called "delta t").

So Sam works out the difference in distance between t and t+t

At 1 second Sam has fallen

d = 5t2 = 5 (1)2 = 5 m

At (1+t) seconds Sam has fallen

d = 5t2 = 5 (1+t)2 m
We can expand (1+t)2:

(1+t)2 = (1+t)(1+t)

= 1 + 2t + (t)2

And we get:

d = 5 (1+2t+(t)2) m

= 5 + 10t + 5(t)2 m

So between 1 second and (1+t) seconds the distance fallen is:

Change in d = (5 + 10t + 5(t)2) 5 m

= 10t + 5(t)2 m

Now divide that distance by time to get the speed:


Speed = 10t +5(t)2 mt s

= 10 + 5t m/s

So the speed is 10 + 5t m/s, and Sam thinks about that t value ... he wants t to be so
small it won't matter ... so he imagines it shrinking towards zero and he gets:

Speed = 10 m/s

Wow! Sam got an answer!

Sam: "I will be falling at exactly 10 m/s"


Alex: "I thought you said you couldn't calculate it?"

Sam: "That was before I used Calculus!"

Yes, indeed, that was Calculus.

The word Calculus comes from Latin meaning "small stone".


Because it is like understanding something by looking at small pieces.

Differential Calculus cuts something into small pieces to find how it changes.

Integral Calculus joins (integrates) the small pieces together to find how much there is.

(And Differential Calculus and Integral Calculus are like inverses of each other, just like
multiplication and division are inverses.)

Sam used Differential Calculus to cut time and distance into such small pieces that a pure
answer came out.

So ... was Sam's result just luck? Does it work for other things?

Let's try doing this for the function y = x3

This is going to be very similar to the previous example, but it will be just a slope on a graph, no
one has to jump for this one!

Example: What is the slope of the function y = x3 at x=1 ?


At x = 1: y = 13 = 1

At x = (1+x): y = (1+x)3

We can expand (1+x)3 to 1 + 3x + 3(x)2 + (x)3, and we get:

y = 1 + 3x + 3(x)2 + (x)3

And the difference between the y values from x = 1 to x = 1+x is:

Change in y = 1 + 3x + 3(x)2 + (x)3 1

= 3x + 3(x)2 + (x)3

Now we can calculate slope:

Slope = 3x + 3(x)2 + (x)3x

= 3 + 3x + (x)2

Once again, as x shrinks towards zero we are left with:

Slope = 3
And here we see the graph of y = x3

The slope is continually changing, but at the


point (1,1) we can draw a line tangent to the curve

and find the slope there really is 3.

(Count the squares if you want!)

Question for you: what is the slope at the point (2,8)?

Try It Yourself!
Go to the Slope of a Function page, put in the formula "x^3", then try to find the slope at the
point (1,1).

Zoom in closer and closer and see what value the slope is heading towards.

Conclusion
Calculus is about changes.

Differential calculus cuts something into small pieces to find how it changes.

Learn more at Introduction to Derivatives

Integral calculus joins (integrates) the small pieces together to find how much there is.

Learn more at Introduction to Integration

Limits (An Introduction)

Approaching ...
Sometimes we can't work something out directly ... but we can see what it should be as we get
closer and closer!

Example:

(x2 1)(x 1)

Let's work it out for x=1:

(12 1)(1 1) = (1 1)(1 1) = 00

Now 0/0 is a difficulty! We don't really know the value of 0/0 (it is "indeterminate"), so we need
another way of answering this.

So instead of trying to work it out for x=1 let's try approaching it closer and closer:

Example Continued:

x (x2 1)(x 1)

0.5 1.50000

0.9 1.90000

0.99 1.99000

0.999 1.99900

0.9999 1.99990

0.99999 1.99999

... ...

Now we see that as x gets close to 1, then (x21)(x1) gets close to 2

We are now faced with an interesting situation:

When x=1 we don't know the answer (it is indeterminate)


But we can see that it is going to be 2
We want to give the answer "2" but can't, so instead mathematicians say exactly what is going
on by using the special word "limit"

The limit of (x21)(x1) as x approaches 1 is 2

And it is written in symbols as:

So it is a special way of saying, "ignoring what happens when we get there, but as we get closer
and closer the answer gets closer and closer to 2"

As a graph it looks like this:

So, in truth, we cannot say what the value at x=1 is.

But we can say that as we approach 1, the limit is 2.

Test Both Sides!

2015 MathsIsFun.com v0.76

It is like running up a hill and then finding the path is magically "not there"...

... but if we only check one side, who knows what happens?

So we need to test it from both directions to be sure where it "should be"!

Example Continued

So, let's try from the other side:

x (x2 1)(x 1)

1.5 2.50000
1.1 2.10000

1.01 2.01000

1.001 2.00100

1.0001 2.00010

1.00001 2.00001

... ...

Also heading for 2, so that's OK

When it is different from different sides

How about a function f(x) with a "break" in it like this:

The limit does not exist at "a"

We can't say what the value at "a" is, because there are two competing answers:

3.8 from the left, and


1.3 from the right

But we can use the special "" or "+" signs (as shown) to define one sided limits:

the left-hand limit () is 3.8


the right-hand limit (+) is 1.3

And the ordinary limit "does not exist"

Are limits only for difficult functions?


Limits can be used even when we know the value when we get there! Nobody said they are
only for difficult functions.

Example:

We know perfectly well that 10/2 = 5, but limits can still be used (if we want!)

Approaching Infinity

Infinity is a very special idea. We know we can't reach it, but we can
still try to work out the value of functions that have infinity in them.

Let's start with an interesting example.

Question: What is the value of 1 ?

Answer: We don't know!

Why Don't We Know?

The simplest reason is that Infinity is not a number, it is an idea.

So 1 is a bit like saying 1beauty or 1tall.

Maybe we could say that 1= 0, ... but that is a problem too, because if we divide 1 into infinite
pieces and they end up 0 each, what happened to the 1?

In fact 1 is known to be undefined.


But We Can Approach It!

So instead of trying to work it out for infinity (because we can't get a sensible answer), let's try
larger and larger values of x:

x 1x

1 1.00000

2 0.50000

4 0.25000

10 0.10000

100 0.01000

1,000 0.00100

10,000 0.00010

Now we can see that as x gets larger, 1x tends towards 0

We are now faced with an interesting situation:

We can't say what happens when x gets to infinity


But we can see that 1x is going towards 0

We want to give the answer "0" but can't, so instead mathematicians say exactly what is going
on by using the special word "limit"

The limit of 1x as x approaches Infinity is 0

And write it like this:

In other words:

As x approaches infinity, then 1x approaches 0


When you see "limit", think "approaching"

It is a mathematical way of saying "we are not talking about when x=, but we know as x gets
bigger, the answer gets closer and closer to 0".

Read more at Limits to Infinity .

Solving!
We have been a little lazy so far, and just said that a limit equals some value because it looked
like it was going to.

That is not really good enough!

Read more at Evaluating Limits .

Limits to Infinity
You should read Limits (An Introduction) first

Infinity is a very special idea. We know we can't reach it, but we can
still try to work out the value of functions that have infinity in them.

One Divided By Infinity


Let's start with an interesting example.

Question: What is the value of 1 ?

Answer: We don't know!


Why don't we know?

The simplest reason is that Infinity is not a number, it is an idea.

So 1 is a bit like saying 1beauty or 1tall.


Maybe we could say that 1= 0, ... but that is a problem too, because if we divide 1 into infinite
pieces and they end up 0 each, what happened to the 1?
In fact 1 is known to be undefined.

But We Can Approach It!

So instead of trying to work it out for infinity (because we can't get a sensible answer), let's try
larger and larger values of x:

x 1x

1 1.00000

2 0.50000

4 0.25000

10 0.10000

100 0.01000

1,000 0.00100

10,000 0.00010

Now we can see that as x gets larger, 1x tends towards 0

We are now faced with an interesting situation:

We can't say what happens when x gets to infinity


But we can see that 1x is going towards 0

We want to give the answer "0" but can't, so instead mathematicians say exactly what is going
on by using the special word "limit"

The limit of 1x as x approaches Infinity is 0

And write it like this:


In other words:

As x approaches infinity, then 1x approaches 0

When you see "limit", think "approaching"

It is a mathematical way of saying "we are not talking about when x=, but we know as x gets
bigger, the answer gets closer and closer to 0".

Summary

So, sometimes Infinity cannot be used directly, but we can use a limit.

What happens at is undefined ... 1x

... but we do know that 1/x approaches 0


as x approaches infinity

Limits Approaching Infinity


What is the limit of this function as x approaches infinity?

y = 2x

Obviously as "x" gets larger, so does "2x":

x y=2x

1 2

2 4

4 8
10 20

100 200

... ...

So as "x" approaches infinity, then "2x" also approaches infinity. We write this:

But don't be fooled by the "=". We cannot actually get to infinity,


but in "limit" language the limit is infinity (which is really saying
the function is limitless).

Infinity and Degree


We have seen two examples, one went to 0, the other went to infinity.

In fact many infinite limits are actually quite easy to work out, when we figure out "which way it
is going", like this

Functions like 1/x approach 0 as x approaches infinity. This is also


true for 1/x2 etc

A function such as x will approach infinity, as well as 2x, or x/9 and


so on. Likewise functions with x2 or x3 etc will also approach infinity.

But be careful, a function like "x" will approach "infinity", so we


have to look at the signs of x.

Example: 2x25x

2x2 will head towards +infinity


5x will head towards -infinity
But x2 grows more rapidly than x, so 2x25x will head towards +infinity

In fact, when we look at the Degree of the function (the highest exponent in the function) we
can tell what is going to happen:

When the Degree of the function is:

greater than 0, the limit is infinity (or infinity)


less than 0, the limit is 0

But if the Degree is 0 or unknown then we need to work a bit harder to find a limit.

Rational Functions

A Rational Function is one that is the ratio of two polynomials:

For example, here P(x) = x3 + 2x 1, and Q(x) = 6x2:

Following on from our idea of the Degree of the Equation , the first step to find the limit is to ...

Compare the Degree of P(x) to the Degree of Q(x):


If the Degree of P is less than the Degree of Q ...

... the limit is 0.

If the Degree of P and Q are the same ...

... divide the coefficients of the terms with the largest exponent, like this:

(note that the largest exponents will be equal, as the degree is equal)

If the Degree of P is greater than the Degree of Q ...


... then the limit is positive infinity ...

... or maybe negative infinity. We need to look at the signs!

We can work out the sign (positive or negative) by looking at the signs of the terms with the
largest exponent, just like how we found the coefficients above:

For example this will go to positive infinity, because both ...

x3 (the term with the largest exponent in the top) and


6x2 (the term with the largest exponent in the bottom)

... are positive.

But this will head for negative infinity, because 2/5 is negative.

A Harder Example: Working Out "e"


There is a formula for the value of e (Euler's number) based on infinity and this formula:

(1+ 1/n)n

At Infinity: (1+1/) = ??? ... we don't know!

So instead of trying to work it out for infinity (because we can't get a sensible answer), let's try
larger and larger values of n:
n (1 + 1/n)n

1 2.00000

2 2.25000

5 2.48832

10 2.59374

100 2.70481

1,000 2.71692

10,000 2.71815

100,000 2.71827

It is heading towards the value 2.71828... which is the magic number e (Euler's Number) .

So again we have an odd situation:

We don't know what the value is when n=infinity


But we can see that it settles towards 2.71828...

So we use limits to write the answer like this:

It is a mathematical way of saying "we are not talking about when n=, but we know as n gets
bigger, the answer gets closer and closer to the value of e".
Don't Do It The Wrong Way ... !

We can see by the graph and the table that as n get larger the function approaches 2.71828....

But trying to use infinity as a "very large real number" (it isn't!) gives this:

(1+1/) = (1+0) = (1) = 1 (Wrong!)

So don't try using Infinity as a real number: you can get wrong answers!

Limits are the right way to go.

Evaluating Limits
I have taken a gentle approach to limits so far, and shown tables and graphs to illustrate the
points.

But to "evaluate" (in other words calculate) the value of a limit can take a bit more effort. Find
out more at Evaluating Limits .

Limits (Evaluating)
You should read Limits (An Introduction) first

Quick Summary of Limits


Sometimes we can't work something out directly ... but we can see what it should be as we get
closer and closer!

Example:
(x2 1)(x 1)

Let's work it out for x=1:

(12 1)(1 1) = (1 1)(1 1) = 00


Now 0/0 is a difficulty! We don't really know the value of 0/0 (it is "indeterminate"), so we need
another way of answering this.

So instead of trying to work it out for x=1 let's try approaching it closer and closer:

Example Continued:

x (x2 1)(x 1)

0.5 1.50000

0.9 1.90000

0.99 1.99000

0.999 1.99900

0.9999 1.99990

0.99999 1.99999

... ...

Now we see that as x gets close to 1, then (x21)(x1) gets close to 2

We are now faced with an interesting situation:

When x=1 we don't know the answer (it is indeterminate)


But we can see that it is going to be 2

We want to give the answer "2" but can't, so instead mathematicians say exactly what is going
on by using the special word "limit"

The limit of (x21)(x1) as x approaches 1 is 2

And it is written in symbols as:

So it is a special way of saying, "ignoring what happens when we get there, but as we get closer
and closer the answer gets closer and closer to 2"
As a graph it looks like this:

So, in truth, we cannot say what the value at x=1 is.

But we can say that as we approach 1, the limit is 2.

Evaluating Limits
"Evaluating" means to find the value of (think e-"value"-ating)

In the example above we said the limit was 2 because it looked like it was going to be. But
that is not really good enough!

In fact there are many ways to get an accurate answer. Let's look at some:

1. Just Put The Value In

The first thing to try is just putting the value of the limit in, and see if it works (in other
words substitution ).

Let's try some examples:

Example Substitute Value Works?

(11)/(11) = 0/0

10/2 = 5

It didn't work with the first one (we knew that!), but the second example gave us a quick and
easy answer.
2. Factors

We can try factoring .

Example:

By factoring (x21) into (x1)(x+1) we get:

Now we can just substitiute x=1 to get the limit:

3. Conjugate

When it's a fraction, multiplying top and bottom by a conjugate might help.

The conjugate is where we change


the sign in the middle of 2 terms like this:

Here is an example where it will help us find a limit:

Evaluating this at x=4 gives 0/0, which is not a good answer!

So, let's try some rearranging:


Multiply top and bottom by the conjugate of the top:

Simplify top using :

Simplify top further:

Cancel (4x) from top and bottom:

So, now we have:

Done!

4. Infinite Limits and Rational Functions

A Rational Function is one that is the ratio of two polynomials:

For example, here P(x) = x3 + 2x 1, and Q(x) = 6x2:

By finding the overall Degree of the Function we can find out whether the function's limit is 0,
Infinity, -Infinity, or easily calculated from the coefficients.
Read more at Limits To Infinity .

5. Formal Method

The formal method sets about proving that we can get as close as we want to the answer by
making "x" close to "a".

Limits (Formal Definition)


Please read Introduction to Limits first

Approaching ...
Sometimes we can't work something out directly ... but we can see what it should be as we get
closer and closer!

Example:
(x2 1)(x 1)

Let's work it out for x=1:

(12 1)(1 1) = (1 1)(1 1) = 00

Now 0/0 is a difficulty! We don't really know the value of 0/0 (it is "indeterminate"), so we need
another way of answering this.

So instead of trying to work it out for x=1 let's try approaching it closer and closer:

Example Continued:

x (x2 1)(x 1)

0.5 1.50000

0.9 1.90000

0.99 1.99000

0.999 1.99900
0.9999 1.99990

0.99999 1.99999

... ...

Now we see that as x gets close to 1, then (x21)(x1) gets close to 2

We are now faced with an interesting situation:

When x=1 we don't know the answer (it is indeterminate)


But we can see that it is going to be 2

We want to give the answer "2" but can't, so instead mathematicians say exactly what is going
on by using the special word "limit"

The limit of (x21)(x1) as x approaches 1 is 2

And it is written in symbols as:

So it is a special way of saying, "ignoring what happens when we get there, but as we get closer
and closer the answer gets closer and closer to 2"

As a graph it looks like this:

So, in truth, we cannot say what the value at x=1 is.

But we can say that as we approach 1, the limit is 2.

More Formal
But instead of saying a limit equals some value because it looked like it was going to, we can
have a more formal definition.

So let's start with the general idea.


From English to Mathematics
Let's say it in English first:

"f(x) gets close to some limit as x gets close to some value"

When we call the Limit "L", and the value that x gets close to "a" we can say

"f(x) gets close to L as x gets close to a"

Calculating "Close"
Now, what is a mathematical way of saying "close" ... could we subtract one value from the
other?

Example 1: 4.01 4 = 0.01


Example 2: 3.8 4 = 0.2

Hmmm ... negatively close? That doesn't work ... we really need to say "I don't care about
positive or negative, I just want to know how far" which is the absolute value .

"How Close" = |ab|

Example 1: |4.014| = 0.01


Example 2: |3.84| = 0.2

And when |ab| is small we know we are close, so we write:

"|f(x)L| is small when |xa| is small"

And this animation shows what happens with the function

f(x) = (x21)(x1)
2015 MathsIsFun.com v0.77

f(x) approaches L=2 as x approaches a=1,


so |f(x)2| is small when |x1| is small.
Delta and Epsilon
But "small" is still English and not "Mathematical-ish".

Let's choose two values to be smaller than:

that |xa| must be smaller than

that |f(x)L| must be smaller than

(Note: Those two greek letters, is "delta" and is "epsilon", are often
used for this, leading to the phrase "delta-epsilon")

And we have:

"|f(x)L|< when |xa|< "

That actually says it! So if you understand that you understand limits ...

... but to be absolutely precise we need to add these conditions:

1) 2) 3)

x not equal to a means 0<|xa|


it is true for any >0 exists, and is >0

And this is what we get:

"for any >0, there is a >0 so that |f(x)L|< when 0<|xa|< "

That is the formal definition. It actually looks pretty scary, doesn't it!

But in essence it still says something simple: when x gets close to a then f(x) gets close to L.
How to Use it in a Proof
To use this definition in a proof, we want to go

From: To:

0<|xa|< |f(x)L|<

This usually means finding a formula for (in terms of ) that works.

How do we find such a formula?

Guess and Test!

That's right, we can:

Play around till we find a formula that might work


Test to see if that formula works.

Example: Let's try to show that

Using the letters we talked about above:

The value that x approaches, "a", is 3


The Limit "L" is 10

So we want to know:

How do we go from: to
0<|x3|< |(2x+4)10|<

Step 1: Play around till you find a formula that might work
Start with:
|(2x+4)10|<

Simplify:
|2x6|<

Move 2 outside:
2|x3|<

Move 2 across:
|x3|< /2

So we can now guess that = /2 might work

Step 2: Test to see if that formula works.

So, can we get from 0<|x3|< to |(2x+4)10|< ... ?

Let's see ...

Start with:
0<|x3|<

Replace : 0<|x3|< /2

Move 2 across:
0<2|x3|<

Move 2 inside:
0<|2x6|<

Replace "6" with "+410"


0<|(2x+4)10|<

Yes! We can go from 0<|x3|< to |(2x+4)10|< by choosing = /2

DONE!

We have seen then that given we can find a , so it is true that:

"for any , there is a so that |f(x)L|< when 0<|xa|< "


And we have proved that

Conclusion
That was a fairly simple proof, but it hopefully explains the strange "there is a ... " wording, and
it does show you a good way of approaching these kind of proofs.

Continuous Functions
A function is continuous when its graph is a single unbroken curve ...

... that you could draw without lifting your pen from the paper.

That is not a formal definition, but it helps you understand the idea.

Here is a continuous function:

Examples
So what is not continuous (also called discontinuous) ?
Look out for holes, jumps or vertical asymptotes (where the function heads up/down towards
infinity).

Not Continuous Not Continuous Not Continuous

(hole) (jump) (vertical asymptote)

Try these different functions so you get the idea:

sin(x)x21/(x-1)(x2-1)/(x-1)sign(x-1.5)

sin(x)
Continuous
Zoom:

Reset
2015 MathsIsFun.com v1.05

(Use slider to zoom, drag graph to reposition, click graph to re-center.)

Domain

A function has a Domain.

In its simplest form the domain is all the values that go into a function.

A function might be continuous or not, depending on its Domain!

Example: 1/(x-1)

At x=1 we have:

1/(1-1) = 1/0 = undefined


So there is a "discontinuity" at x=1

f(x) = 1/(x-1)
g(x) = 1/(x-1) for x>1
over all Real Numbers

NOT continuous Continuous

g(x) does not include the value x=1, so it is continuous.

So when a function is continuous within its Domain, it is a continuous function.

More Formally !
We can define continuous using Limits (it helps to read that page first):

A function f is continuous when, for every value c in its Domain:

f(c) is defined, and:

"the limit of f(x) as x approaches c equals f(c)"

The limit says:

"as x gets closer and closer to c


then f(x) gets closer and closer to f(c)"

And we have to check from both directions:


as x approaches c (from left)
then f(x) approaches f(c)

AND
as x approaches c (from right)
then f(x) approaches f(c)

If we get different values from left and right (a "jump"), then the limit does not exist!

How to Use:
Make sure that, for all x values:

f(x) is defined
and the limit at x equals f(x)

Here are some examples:

Example: f(x) = (x2-1)/(x-1) for all Real Numbers

The function is undefined when x=1:


(x2-1)/(x-1) = (12-1)/(1-1) = 0/0

So it is not a continuous function

Let us change the domain:

Example: g(x) = (x2-1)/(x-1) over the interval x<1

Almost the same function, but now it is over an interval that does not include x=1.

So now it is a continuous function (does not include the "hole")

Example: How about this piecewise function:

which looks like:

It is defined at x=1, because h(1)=2 (no "hole")

But at x=1 you can't say what the limit is, because there are two competing answers:

"2" from the left, and


"1" from the right

so in fact the limit does not exist at x=1 (there is a "jump")

And so the function is not continuous.

But:
Example: How about the piecewise function absolute value:

which looks like:

At x=0 it has a very pointy change!

But it is still defined at x=0, because f(0)=0 (so no "hole"),

And the limit as you approach x=0 (from either side) is also 0 (so no "jump"),

So it is in fact continuous.

(But it is not differentiable .)

Introduction to Derivatives
It is all about slope!

Slope = Change in YChange in X

We can find an average slope between two points.

But how do we find the slope at a point?


There is nothing to measure!

But with derivatives we use a small difference ...

... then have it shrink towards zero.

Let us Find a Derivative!


To find the derivative of a function y = f(x) we use the slope formula:

Slope = Change in YChange in X = yx

And (from diagram) we see that:

x changes from x to x+x

y changes from f(x) to f(x+x)

Now follow these steps:

Fill in this slope formula: yx = f(x+x) f(x)x


Simplify it as best we can
Then make x shrink towards zero.

Like this:

Example: the function f(x) = x2

We know f(x) = x2, and can calculate f(x+x) :

Start with: f(x+x) = (x+x)2


Expand (x + x)2: f(x+x) = x2 + 2x x + (x)2

The slope formula is: f(x+x) f(x)x

Put in f(x+x) and f(x): x2 + 2x x + (x)2 x2x

Simplify (x2 and x2 cancel): 2x x + (x)2x

Simplify more (divide through by x): = 2x + x

And then as x heads towards 0 we get: = 2x

Result: the derivative of x2 is 2x

We write dx instead of "x heads towards 0", so "the derivative of" is commonly written

x2 = 2x
"The derivative of x2 equals 2x"
or simply "d dx of x2 equals 2x"

What does x2 = 2x mean?

It means that, for the function x2, the slope or "rate of change" at any point is 2x.

So when x=2 the slope is 2x = 4, as shown here:

Or when x=5 the slope is 2x = 10, and so on.

Note: sometimes f(x) is also used for "the derivative of":


f(x) = 2x
"The derivative of f(x) equals 2x"
or simply "f-dash of x equals 2x"

Let's try another example.

Example: What is x3 ?

We know f(x) = x3, and can calculate f(x+x) :

Start with: f(x+x) = (x+x)3

Expand (x + x)3: f(x+x) = x3 + 3x2 x + 3x (x)2 + (x)3

The slope formula: f(x+x) f(x)x

Put in f(x+x) and f(x): x3 + 3x2 x + 3x (x)2 + (x)3 x3x

Simplify (x3 and x3 cancel): 3x2 x + 3x (x)2 + (x)3x

Simplify more (divide through by x): = 3x2 + 3x x + (x)2

And then as x heads towards 0 we get:


x3 = 3x2

Have a play with it using the Derivative Plotter .

Derivatives of Other Functions


We can use the same method to work out derivatives of other functions (like sine, cosine,
logarithms, etc).

But in practice the usual way to find derivatives is to use:


Derivative Rules

Example: what is the derivative of sin(x) ?

On Derivative Rules it is listed as being cos(x)

Done.

Using the rules can be tricky!

Example: what is the derivative of cos(x)sin(x) ?

You can't just find the derivative of cos(x) and multiply it by the derivative of sin(x) ... you must
use the "Product Rule" as explained on the Derivative Rules page.

It actually works out to be cos2(x) - sin2(x)

So that is your next step: learn how to use the rules.

Notation
"Shrink towards zero" is actually written as a limit like this:

"The derivative of f equals the limit as x goes to zero of f(x+x) - f(x) over x"

Or sometimes the derivative is written like this (explained on Derivatives as dy/dx ):


The process of finding a derivative is called "differentiation".

You do differentiation ... to get a derivative.

Where to Next?
Go and learn how to find derivatives using Derivative Rules , and get plenty of practice.

Derivative Rules
The Derivative tells us the slope of a function at any point.

There are rules we can follow to find many derivatives.

For example:

The slope of a constant value (like 3) is always 0


The slope of a line like 2x is 2, or 3x is 3 etc
and so on.

Here are useful rules to help you work out the derivatives of many functions (with examples
below ). Note: the little mark means "Derivative of".

Common Functions Function Derivative

Constant c 0

Line x 1

ax a

Square x2 2x

Square Root x ()x-

Exponential ex ex
ax ln(a) ax

Logarithms ln(x) 1/x

loga(x) 1 / (x ln(a))

Trigonometry (x is in radians) sin(x) cos(x)

cos(x) sin(x)

tan(x) sec2(x)

Inverse Trigonometry sin-1(x) 1/(1x2)

cos-1(x) 1/(1x2)

tan-1(x) 1/(1+x2)

Rules Function Derivative

Multiplication by constant cf cf

Power Rule xn nxn1

Sum Rule f+g f + g

Difference Rule f-g f g

Product Rule fg f g + f g

Quotient Rule f/g (f g g f )/g2

Reciprocal Rule 1/f f/f2

Chain Rule
fg (f g) g
(as "Composition of Functions")
Chain Rule (using ) f(g(x)) f(g(x))g(x)

Chain Rule (using ddx ) dydx = dydududx

"The derivative of" is also written ddx


So ddxsin(x) and sin(x) are the same thing, just written differently

Examples
Example: what is the derivative of sin(x) ?

From the table above it is listed as being cos(x)

It can be written as:

sin(x) = cos(x)

Or:

sin(x) = cos(x)

Power Rule

Example: What is x3 ?

The question is asking "what is the derivative of x3?"

We can use the Power Rule, where n=3:

xn = nxn1

x3 = 3x31 = 3x2

Example: What is (1/x) ?

1/x is also x-1

We can use the Power Rule, where n = 1:


xn = nxn1

x1 = 1x11 = x2

Multiplication by constant

Example: What is 5x3 ?

the derivative of cf = cf

the derivative of 5f = 5f

We know (from the Power Rule):

x3 = 3x31 = 3x2

So:

5x3 = 5 x3 = 5 3x2 = 15x2

Sum Rule

Example: What is the derivative of x2+x3 ?

The Sum Rule says:

the derivative of f + g = f + g

So we can work out each derivative separately and then add them.

Using the Power Rule:

x2 = 2x

x3 = 3x2

And so:

the derivative of x2 + x3 = 2x + 3x2


Difference Rule

It doesn't have to be x, we can differentiate with respect to, for example, v:

Example: What is (v3v4) ?

The Difference Rule says

the derivative of f g = f g

So we can work out each derivative separately and then subtract them.

Using the Power Rule:

v3 = 3v2

v4 = 4v3

And so:

the derivative of v3 v4 = 3v2 4v3

Sum, Difference, Constant Multiplication And Power Rules

Example: What is (5z2 + z3 7z4) ?

Using the Power Rule:

z2 = 2z

z3 = 3z2

z4 = 4z3

And so:

(5z2 + z3 7z4) = 5 2z + 3z2 7 4z3 = 10z + 3z2 28z3


Product Rule

Example: What is the derivative of cos(x)sin(x) ?

The Product Rule says:

the derivative of fg = f g + f g

In our case:

f = cos
g = sin

We know (from the table above):

cos(x) = sin(x)

sin(x) = cos(x)

So:

the derivative of cos(x)sin(x) = cos(x)cos(x) sin(x)sin(x)

= cos2(x) sin2(x)

Reciprocal Rule

Example: What is (1/x) ?

The Reciprocal Rule says:

the derivative of 1/f = f/f2

With f(x)= x, we know that f(x) = 1

So:

the derivative of 1/x = 1/x2

Which is the same result we got above using the Power Rule.
Chain Rule

Example: What is ddxsin(x2) ?

sin(x2) is made up of sin() and x2:

f(g) = sin(g)
g(x) = x2

The Chain Rule says:

the derivative of f(g(x)) = f'(g(x))g'(x)

The individual derivatives are:

f'(g) = cos(g)
g'(x) = 2x

So:

ddxsin(x2) = cos(g(x)) (2x)

= 2x cos(x2)

Another way of writing the Chain Rule is: dydx = dydududx

Let's do the previous example again using that formula:

Example: What is ddxsin(x2) ?


dydx = dydududx

Have u = x2, so y = sin(u):

ddx sin(x2) = ddusin(u)ddxx2

Differentiate each:

ddx sin(x2) = cos(u) (2x)

Substitue back u = x2 and simplify:

ddx sin(x2) = 2x cos(x2)

Same result as before (thank goodness!)

Another couple of examples of the Chain Rule:


Example: What is (1/cos(x)) ?

1/cos(x) is made up of 1/g and cos():

f(g) = 1/g
g(x) = cos(x)

The Chain Rule says:

the derivative of f(g(x)) = f(g(x))g(x)

The individual derivatives are:

f'(g) = 1/(g2)
g'(x) = sin(x)

So:

(1/cos(x)) = 1/(g(x))2 sin(x)

= sin(x)/cos2(x)

Note: sin(x)/cos2(x) is also tan(x)/cos(x), or many other forms.

Example: What is (5x2)3 ?

The Chain Rule says:

the derivative of f(g(x)) = f(g(x))g(x)

(5x-2)3 is made up of g3 and 5x-2:

f(g) = g3
g(x) = 5x2

The individual derivatives are:

f'(g) = 3g2 (by the Power Rule)


g'(x) = 5
So:

(5x2)3 = 3g(x)2 5 = 15(5x2)2

Second Derivative
(Read about derivatives first if you don't already know what they are!)

A derivative basically gives you the slope of a function at any point.

The "Second Derivative" is the derivative of the derivative of a function. So:

Find the derivative of a function


Then take the derivative of that

A derivative is often shown with a little tick mark: f'(x)


The second derivative is shown with two tick marks like this: f''(x)

Example: f(x) = x3

Its derivative is f'(x) = 3x2


The derivative of 3x2 is 6x, so the second derivative of f(x) is:

f''(x) = 6x

dy d2y
A derivative can also be shown as: , and the second derivative shown as:
dx dx2

Example: (continued)

The previous example could be written like this:

y = x3

dy = 3x2
dx

d2y
= 6x
2
dx

Distance, Speed and Acceleration


A common real world example of this is distance, speed and acceleration:

Example: A bike race!

You are cruising along in a bike race, going a steady 10 m every second.

Distance: is how far you have moved along your path. It is common to use s for distance (from
the Latin "spatium").

So let us use:

distance (in meters): s


time (in seconds): t

Speed: is how much your distance s changes over time t ...

... and is actually the first derivative of distance with respect to time: dsdt

And we know you are doing 10 m per second, so dsdt = 10 m/s

Acceleration: Now you start cycling faster! You increase your speed to 14 m every
second over the next 2 seconds.

When you are accelerating your speed is changing over time.


So dsdt is changing over time!

d dsdt
We could write it like this:
dt

But it is usually written d2sdt2

Your speed increases by 4 m/s over 2 seconds, so d2sdt2 = 42 = 2 m/s2

Your speed changes by 2 meters per second per second.


And yes, "per second" is used twice!
It can be thought of as (m/s)/s but is usually written m/s2

(Note: in the real world your speed and acceleration changes moment to moment, but here we
assume you can hold a constant speed or constant acceleration.)

So:

Example
Measurement

Distance: s 100 m

First Derivative is Speed: dsdt 10 m/s

Second Derivative is Acceleration: d2sdt2 2 m/s2

And the third derivative (how acceleration changes over time) is called "Jolt" ... !

Derivatives where we treat other variables as constants.

Here is a function of one variable (x):

f(x) = x2
And its derivative (using the Power Rule ) is:

f(x) = 2x

But what about a function of two variables (x and y):

f(x,y) = x2 + y3

To find its partial derivative with respect to x we treat y as a constant (imagine y is a


number like 7 or something):

fx = 2x + 0 = 2x

Explanation:

the derivative of x2 (with respect to x) is 2x


we treat y as a constant, so y3 is also a constant (imagine y=7, then 73=343 also a constant),
and the derivative of a constant is 0

To find the partial derivative with respect to y, we treat x as a constant:

fy = 0 + 3y2 = 3y2

Explanation:

we now treat x as a constant, so x2 is also a constant, and the derivative of a constant is 0


the derivative of y3 (with respect to y) is 3y2

That is all there is to it. Just remember to treat all other variables as if they are constants.

Holding A Variable Constant

So what does "holding a variable constant" look like?


Example: the volume of a cylinder is V = r2 h

We can write that in "multi variable" form as

f(r,h) = r2 h

For the partial derivative with respect to r we hold h constant, and r changes:

fr = (2r) h = 2rh
(The derivative of r2 with respect to r is 2r, and and h are constants)

It says "as only the radius changes (by the tiniest amount), the volume changes by 2rh"

It is like we add a skin with a circle's circumference (2r) and a height of h.

For the partial derivative with respect to h we hold r constant:

fh = r2 (1)= r2
( and r2 are constants, and the derivative of h with respect to h is 1)

It says "as only the height changes (by the tiniest amount), the volume changes by r 2"

It is like we add the thinnest disk on top with a circle's area of r 2.

Let's see another example.

Example: The surface area of a square prism.

The surface is: the top and bottom with areas of x2 each, and 4 sides of area xy:
f(x,y) = 2x2 + 4xy

fx = 4x + 4y
fy = 0 + 4x = 4x

Three or More Variables

We can have 3 or more variables. Just find the partial derivative of each variable in turn
while treatingall other variables as constants.

Example: The volume of a cube with a square prism cut out from it.

f(x,y,z) = z3 x2y

fx = 0 2xy = 2xy
fy = 0 x2 = x2
fz = 3z2 0 = 3z2

When there are many x's and y's it can get confusing, so a mental trick is to change the
"constant" variables into letters like "c" or "k" that look like constants.

Example: f(x,y) = y3sin(x) + x2tan(y)

It has x's and y's all over the place! So let us try the letter change trick.

With respect to x we can change "y" to "k":

f(x,y) = k 3sin(x) + x2tan( k )

fx = k3cos(x) + 2x tan(k)

But remember to turn it back again!

fx = y3cos(x) + 2x tan(y)

Likewise with respect to y we turn the "x" into a "k":

f(x,y) = y3sin( k ) + k 2tan(y)

fy = 3y2sin(k) + k2sec2(y)
fy = 3y2sin(x) + x2sec2(y)
But only do this if you have trouble remembering, as it is a little extra work.

Notation: here we use fx to mean "the partial derivative with respect to x", but another very
common notation is to use a funny backwards d () like this:

fx = 2x

Which is the same as:

fx = 2x

is called "del" or "dee" or "curly dee"

So fx is said "del f del x"

Example: find the partial derivatives of f(x,y,z) = x4 3xyz using "curly dee"
notation

f(x,y,z) = x4 3xyz

fx = 4x3 3yz
fy = 3xz
fz = 3xy

You might prefer that notation, it certainly looks cool.

Differentiable
Differentiable means that the derivative exists ...

Example: is x2 + 6x differentiable?

Derivative rules tell us the derivative of x2 is 2x and the derivative of x is 1, so:

Its derivative is 2x + 6

So yes! x2 + 6x is differentiable.

... and it must exist for every value in the function's domain .
Domain

In its simplest form the domain is


all the values that go into a function

Example (continued)

When not stated we assume that the domain is the Real Numbers .

For x2 + 6x, its derivative of 2x + 6 exists for all Real Numbers.

So we are still safe: x2 + 6x is differentiable.

But what about this:

Example: The function f(x) = |x| (absolute value):

|x| looks like this:

At x=0 it has a very pointy change!

Does the derivative exist at x=0?

Testing
We can test any value "c" by finding if the limit exists:

f(c+h) f(c)
lim
h0
h
Example (continued)

Let's calculate the limit for |x| at the value 0:

|0+h| |0| |h| 0 |h|


lim lim lim
= =
h0 h0 h0
h h h

The limit does not exist

To see why, let's compare left and right side limits:

From Left Side: From Right Side:

|h| |h|
lim lim
= 1 = +1
h0 h0+
h h

The limits are different on either side, so the limit does not exist.

So the function f(x) = |x| is not differentiable

A good way to picture this in your mind is to think:

As I zoom in, does the function tend to become a straight line?

The absolute value function stays pointy even when zoomed in.

Other Reasons
Here are a few more examples:

The Floor and Ceiling Functions are not differentiable at integer


values, as there is a discontinuity at each jump. But they are
differentiable elsewhere.

The Cube root function x(1/3)

Its derivative is (1/3)x-(2/3) (by the Power Rule )

At x=0 the derivative is undefined, so x(1/3) is not differentiable.


At x=0 the function is not defined so it makes no sense to ask if they are differentiable
there.

To be differentiable at a certain point, the function must first of all be defined there!

As we head towards x = 0 the function moves up and down faster and faster, so we
cannot find a value it is "heading towards".

So it is not differentiable.

Different Domain
But we can change the domain!

Example: The function g(x) = |x| with Domain (0,+)

The domain is from but not including 0 onwards (all positive values).

Which IS differentiable.

And I am "absolutely positive" about that :)


So the function g(x) = |x| with Domain (0,+) is differentiable.

We could also restrict the domain in other ways to avoid x=0 (such as all negative Real
Numbers, all non-zero Real Numbers, etc).

Why Bother?
Because when a function is differentiable we can use all the power of calculus when working with
it.

Continuous
When a function is differentiable it is also continuous .

Differentiable Continuous
But a function can be continuous but not differentiable. For example the absolute value
function is actually continuous (though not differentiable) at x=0.

Finding Maxima and Minima using Derivatives


Where is a function at a high or low point? Calculus can help!

A maximum is a high point and a minimum is a low point:

In a smoothly changing function a maximum or minimum is always where the function flattens
out (except for a saddle point).

Where does it flatten out? Where the slope is zero.

Where is the slope zero? The Derivative tells us!

Let's dive right in with an example:


Example: A ball is thrown in the air. Its height at any time t is given by:

h = 3 + 14t 5t2

What is its maximum height?

Using derivatives we can find the slope of that function:

h = 0 + 14 5(2t)
= 14 10t

(See below this example for how we found that derivative.)

Now find when the slope is zero:

14 10t = 0

10t = 14

t = 14 / 10 = 1.4

The slope is zero at t = 1.4 seconds

And the height at that time is:

h = 3 + 141.4 51.42

h = 3 + 19.6 9.8 = 12.8

And so:

The maximum height is 12.8 m (at t = 1.4 s)


A Quick Refresher on Derivatives
A derivative basically finds the slope of a function.

In the previous example we took this:

h = 3 + 14t 5t2
and came up with this derivative:

h = 0 + 14 5(2t)
= 14 10t
Which tells us the slope of the function at any time t

We used these Derivative Rules :

The slope of a constant value (like 3) is 0


The slope of a line like 2x is 2, so 14t has a slope of 14
A square function like t2 has a slope of 2t, so 5t2 has a slope of 5(2t) = 10t
And then we added them up

How Do We Know it is a Maximum (or Minimum)?


We saw it on the graph! But otherwise ... derivatives come to the rescue again.

Take the derivative of the slope (the second derivative of the original function):

The Derivative of 14 10t is 10

This means the slope is continually getting smaller (10): traveling from left to right the slope
starts out positive (the function rises), goes through zero (the flat point), and then the slope
becomes negative (the function falls):

A slope that gets smaller (and goes though 0) means a maximum.

This is called the Second Derivative Test


On the graph above I showed the slope before and after, but in practice we do the test at the
point where the slope is zero:

Second Derivative Test


When a function's slope is zero at x, and the second derivative at x is:

less than 0, it is a local maximum


greater than 0, it is a local minimum
equal to 0, then the test fails (there may be other ways of finding out though)

"Second Derivative: less than 0 is a maximum, greater than 0 is a minimum"

Example: Find the maxima and minima for:

y = 5x3 + 2x2 3x

The derivative (slope) is:

y = 15x2 + 4x 3

Which is quadratic with zeros at:

x = 3/5
x = +1/3

Could they be maxima or minima? (Don't look at the graph yet!)

The second derivative is y'' = 30x + 4

At x = 3/5:

y'' = 30(3/5) + 4 = 14

it is less than 0, so 3/5 is a local maximum


At x = +1/3:

y'' = 30(+1/3) + 4 = +14

it is greater than 0, so +1/3 is a local minimum

(Now you can look at the graph.)

Words
A high point is called a maximum (plural maxima).

A low point is called a minimum (plural minima).

The general word for maximum or minimum is extremum (plural extrema).

We say local maximum (or minimum) when there may be higher (or lower) points elsewhere but
not nearby.

One More Example


Example: Find the maxima and minima for:

y = x3 6x2 + 12x 5

The derivative is:

y = 3x2 12x + 12

Which is quadratic with only one zero at x = 2


Is it a maximum or minimum?

The second derivative is y'' = 6x 12

At x = 2:

y'' = 6(2) 12 = 0

it is 0, so the test fails

And here is why:

It is a saddle point ... the slope does become zero, but it is neither a maximum or minimum.

Must Be Differentiable.
And there is an important technical point:

The function must be differentiable (the derivative must exist at each point in its domain).

Example: How about the function f(x) = |x| (absolute value) ?

|x| looks like this:

At x=0 it has a very pointy change!


In fact it is not differentiable there (as shown on the differentiable page).

So we can't use this method for the absolute value function.

The function must also be continuous , but any function that is differentiable is also continuous,
so no need to worry about that.

Concave Upward and Downward

Concave upward is when the slope increases:

Concave downward is when the slope decreases:

What about when the slope stays the same (straight line)? It could be both! See footnote .

Here are some more examples:

Concave Downward is also called Concave or Convex Upward

Concave Upward is also called Convex or Convex Downward

Finding where ...


Usually our task is to find where a curve is concave upward or concave downward:

Definition
The key point is that a line drawn between any two points on the curve won't cross over the
curve:

Let's make a formula for that!

First, the line: take any two different values a and b (in the interval we are looking at):

Then "slide" between a and b using a value t (which is from 0 to 1):

x = ta + (1t)b

When t=0 we get x = 0a+1b = b


When t=1 we get x = 1a+0b = a
When t is between 0 and 1 we get values between a and b

Now work out the heights at that x-value:

When x = ta + (1t)b:

The curve is at y = f( ta + (1t)b )


The line is at y = tf(a) + (1t)f(b)

And (for concave upward) the line should not be below the curve:

For concave downward the line should not be above the curve ( becomes ):

And those are the actual definitions of concave upward and concave downward.

Remembering
Which way is which? Think:
Concave Upwards = CUP

Calculus
Derivatives can help! The derivative of a function gives the slope.

When the slope continually increases, the function is concave upward.


When the slope continually decreases, the function is concave downward.

Taking the second derivative actually tells us if the slope continually increases or decreases.

When the second derivative is positive, the function is concave upward.


When the second derivative is negative, the function is concave downward.
Example: the function x2

Its derivative is 2x (see Derivative Rules )

2x continually increases, so the function isconcave upward.

Its second derivative is 2

2 is positive, so the function is concave upward.

Both give the correct answer.

Example: f(x) = 5x3 + 2x2 3x

Let's work out the second derivative:

The derivative is f'(x) = 15x2 + 4x 3 (using Power Rule)


The second derivative is f''(x) = 30x + 4 (using Power Rule)
And 30x + 4 is negative up to x = 4/30 = 2/15, and positive from there onwards. So:

f(x) is concave downward up to x = 2/15

f(x) is concave upward from x = 2/15 on

Note: The point where it changes is called an inflection point .

Footnote: Slope Stays the Same


What about when the slope stays the same (straight line)?

A straight line is acceptable for Concave upward or Concave downward.

But a straight line is not OK when we say Strictly Concave upward or Strictly Concave
downward.

Example: y = 2x + 1
2x + 1 is a straight line.

It is Concave upward.
It is also Concave downward.

It is not Strictly Concave upward.


And it is not Strictly Concave downward.

mplicit Differentiation
Finding the derivative when you cant solve for y
You may like to read Introduction to Derivatives and Derivative Rules first.

Implicit vs Explicit
A function can be explicit or implicit:

Explicit: "y = some function of x". When we know x we can calculate y directly.

Implicit: "some function of y and x equals something else". Knowing x does not lead directly to
y.

Example: A Circle

Explicit Form Implicit Form

y = (r2 x2) x2 + y2 = r2

In this form, y is expressed In this form, the function is


as a function of x. expressed in terms of both y and x.
The graph of x2 + y2 = 32

Inflection Points
An Inflection Point is where a curve changes from Concave upward to Concave downward (or
vice versa)

So what is concave upward / downward ?

Concave upward is when the slope increases:

Concave downward is when the slope decreases:

Here are some more examples:

Learn more at Concave upward and Concave downward .

Finding where ...


So our task is to find where a curve goes from concave upward to concave downward (or vice
versa).
Calculus
Derivatives help us!

The derivative of a function gives the slope.

The second derivative tells us if the slope increases or decreases.

When the second derivative is positive, the function is concave upward.


When the second derivative is negative, the function is concave downward.

And the inflection point is where it goes from concave upward to concave downward (or vice
versa).

Example: y = 5x3 + 2x2 3x

Let's work out the second derivative:

The derivative is y' = 15x2 + 4x 3


The second derivative is y'' = 30x + 4

And 30x + 4 is negative up to x = 4/30 = 2/15, positive from there onwards. So:

f(x) is concave downward up to x = 2/15

f(x) is concave upward from x = 2/15 on

And the inflection point is at x = 2/15

A Quick Refresher on Derivatives


In the previous example we took this:

y = 5x3 + 2x2 3x

and came up with this derivative:

y' = 15x2 + 4x 3

There are rules you can follow to find derivatives, and we used the "Power Rule" :
x3 has a slope of 3x2, so 5x3 has a slope of 5(3x2) = 15x2
x2 has a slope of 2x, so 2x2 has a slope of 2(2x) = 4x
The slope of the line 3x is 3

Another example for you:

Example: y = x3 6x2 + 12x 5

The derivative is: y' = 3x2 12x + 12

The second derivative is: y'' = 6x 12

And 6x 12 is negative up to x = 2, positive from there onwards. So:

f(x) is concave downward up to x = 2

f(x) is concave upward from x = 2 on

And the inflection point is at x = 2:

How to do Implicit Differentiation


Differentiate with respect to x
Collect all the dydx on one side
Solve for dydx
Example: x2 + y2 = r2

Differentiate with respect to x:

ddx(x2) + ddx(y2) = ddx(r2)


Let's solve each term:

ddx(x2) = 2x Using the Power Rule ddxxn = nxn1

ddx(y2) = 2ydydx Using the Chain Rule (explained below)

ddx(r2) = 0 r2 is a constant, so its derivative is 0

Which gives us:

2x + 2ydydx = 0

Collect all the dydx on one side

ydydx = x

Solve for dydx:

dydx = xy

The Chain Rule Using dydx

Let's look more closely at how ddx(y2) becomes 2ydydx

The Chain Rule says:

dudx = dudydydx

Substitute in u = y2:

ddx(y2) = ddy(y2)dydx

And then:

ddx(y2) = 2ydydx

Basically, all we did was differentiate with respect to y and multiply by dydx

Another common notation is to use to mean ddx

The Chain Rule Using

The Chain Rule can also be written using notation:


f(g(x)) = f(g(x))g(x)

g(x) is our function "y", so:

f(y) = f(y)y

f(y) = y2, so f(y) = 2y:

f(y) = 2yy

or alternatively: f(y) = 2y dydx

Again, all we did was differentiate with respect to y and multiply by dydx

Explicit
Let's also find the derivative using the explicit form of the equation.

To solve this explicitly, we can solve the equation for y


Then differentiate
Then substitute the equation for y again
Example: x2 + y2 = r2
Subtract x2 from both sides: y2 = r2 x2

Square root: y = (r2 x2)

Let's do just the positive: y = (r2 x2)

As a power: y = (r2 x2)

Derivative (Chain Rule): y =(r2 x2)(2x)

Simplify: y = x(r2 x2)

Simplify more: y = x(r2 x2)


Now, because y = (r2 x2): y = x/y

We get the same result this way!

You can try taking the derivative of the negative term yourself.

Chain Rule Again!

Yes, we used the Chain Rule again. Like this (note different letters, but same rule):

dydx = dydfdfdx

Substitute in f = (r2 x2):

ddx(f) = ddf(f)ddx(r2 x2)

Derivatives:

ddx(f) = (f) (2x)

And substitute back f = (r2 x2):

ddx(r2 x2) = ((r2 x2)) (2x)

And we simplified from there.

Example Using The Derivative


OK, so why find the derivative y = x/y ?

Well, for example, we can find the slope of a tangent line.


Example: what is the slope of a circle centered at the origin with a radius of 5 at
the point (3,4)?

No problem, just substitute it into our equation:

dydx = x/y

dydx = 3/4

And for bonus, the equation for the tangent line is:

y = 3/4 x + 25/4

Another Example
Sometimes the implicit way works where the explicit way is hard or impossible.

Example: 10x4 - 18xy2 + 10y3 = 48

How do we solve for y? We don't have to!

First, differentiate with respect to x (use the Product Rule for the xy2 term).
Then move all dy/dx terms to the left side.
Solve for dy/dx
Like this:

Start with: 10x4 18xy2 + 10y3 = 48

Derivative: 10 (4x3) 18(x(2ydydx) + y2) + 10(3y2dydx) = 0

(the middle term is explained below)

Simplify: 40x3 36xydydx 18y2 + 30y2dydx = 0

dydx on left: 36xydydx + 30y2dydx = 40x3 + 18y2

Simplify : (30y236xy)dydx= 18y240x3

Simplify : 3(5y26xy)dydx= 9y220x3

And we get:

9y220x3
dydx =
3(5y26xy)

Product Rule

For the middle term we used the Product Rule: (fg) = f g + f g

(xy2) = x(y2) + (x)y2

= x(2ydydx) + y2

Because (y2) = 2ydydx(we worked that out in a previous example)


Oh, and dxdx= 1, in other words (x) = 1

Inverse Functions
Implicit differentiation can help us solve inverse functions.

The general pattern is:

Start with the inverse equation in explicit form. Example: y = sin1(x)


Rewrite it in non-inverse mode: Example: x = sin(y)
Differentiate this function with respect to x on both sides.
Solve for dy/dx

As a final step we can try to simplify more by substituting the original equation.

An example will help:

Example: the inverse sine function y = sin1(x)


Start with: y = sin1(x)

In non-inverse mode: x = sin(y)

Derivative: ddx(x) = ddxsin(y)

1 = cos(y) dydx

Put dydx on left: dydx= 1cos(y)

We can also go one step further using the Pythagorean identity:

sin2 y + cos2 y = 1

cos y = (1 sin2 y )

And, because sin(y) = x (from above!), we get:

cos y = (1 x2)

Which leads to:

dydx= 1(1 x2)

Example: the derivative of square root x


Start with: y = x

So: y2 = x
Derivative: 2ydydx= 1

Simplify: dydx = 12y

Because y = x: dydx = 12x

Note: this is the same answer we get using the Power Rule:

Start with: y = x

As a power: y = x

Power Rule ddxxn = nxn1: dydx = ()x

Simplify: dydx = 12x

Summary
To Implicitly derive a function (useful when a function can't easily be solved for y)
Differentiate with respect to x
Collect all the dy/dx on one side
Solve for dy/dx
To derive an inverse function, restate it without the inverse then use Implicit differentiation

Taylor Series
A Taylor Series is an expansion of a function into an infinite sum of terms.

Example: The Taylor Series for ex

It says that the function: ex


is equal to the infinite sum of terms: 1 + x + x2/2! + x3/3! + ... etc

(Note: ! is the Factorial Function .)

Does it really work?

Example: ex for x=2


We can calculate e2 = 2.71828... 2.71828... = 7.389056...
Or use the series 1 + 2 + 22/2! + 23/3! = 6.333...

Hmmm... that wasn't even close, let's try some more terms:

1 + 2 + 22/2! + 23/3! + 24/4! + 25/5! = 7.2666...

OK, getting better! The more terms we use the closer we get.

Using "2^n/fact(n)" and n=0 to 10 in the Sigma Calculator we get 7.38899...


What do you get with n=0 to 20?

Here are some common Taylor Series:

Taylor Series expansion As Sigma Notation

(There are many more.)


Approximations
We can use the first few terms of a Taylor Series to get an approximate value for a function.

Here we show better and better approximations for cos(x). The red line is cos(x), the blue is
the approximation ( try plotting it yourself ) :

1 x2/2!

1 x2/2! + x4/4!

1 x2/2! + x4/4! x6/6!

1 x2/2! + x4/4! x6/6! + x8/8!

You can also see the Taylor Series in action at Euler's Formula for Complex Numbers .

What is this Magic?


How can we turn a function into a series of power terms like this?
Well, it isn't really magic. First we say we want to have this expansion:

f(x) = c0 + c1(x-a) + c2(x-a)2 + c3(x-a)3 + ...

Then we choose a value "a", and work out the values c0 , c1 , c2 , ... etc

And it is done using derivatives (so we must know the derivative of our function)

Quick review: a derivative gives us the slope of a function at any point.


These basic derivative rules can help us:

The derivative of a constant is 0


The derivative of x is 1
The derivative of xn is nxn-1 (Example: the derivative of x3 is 3x2)

We will use the little mark to mean "derivative of".

OK, let's start:

To get c0, choose x=a so all the (x-a) terms become zero, leaving us with:

f(a) = c0

So c0 = f(a)

To get c1, take the derivative of f(x):

f(x) = c1 + 2c2(x-a) + 3c3(x-a)2 + ...

With x=a all the (x-a) terms become zero:

f(a) = c1

So c1 = f(a)

To get c2, do the derivative again:

f(x) = 2c2 + 32c3(x-a) + ...

With x=a all the (x-a) terms become zero:

f(a) = 2c2

So c2 = f(a)/2
In fact, a pattern is emerging. Each term is

the next higher derivative ...


... divided by all the exponents so far multiplied together (for which we can use factorial notation,
for example 3! = 321)

And we get:

f(x) = f(a) + f'(a)1!(x-a) + f''(a)2!(x-a)2 + f'''(a)3!(x-a)3 + ...

Now we have a way of finding our own Taylor Series:

For each term: take the next derivative, divide by n!, multiply by (x-a)n

Example: Taylor Series for cos(x)

Start with:

f(x) = f(a) + f'(a)1!(x-a) + f''(a)2!(x-a)2 + f'''(a)3!(x-a)3 + ...

The derivative of cos is sin, and the derivative of sin is cos, so:

f(x) = cos(x)
f'(x) = sin(x)
f''(x) = cos(x)
f'''(x) = sin(x)
etc...

And we get:

cos(x) = cos(a) sin(a)1!(x-a) cos(a)2!(x-a)2 + sin(a)3!(x-a)3 + ...

Now put a=0, which is nice because cos(0)=1 and sin(0)=0:

cos(x) = 1 01!(x-0) 12!(x-0)2 + 03!(x-0)3 + 14!(x-0)4 + ...

Simplify:

cos(x) = 1 x2/2! + x4/4! ...

Try that for sin(x) yourself, it will help you to learn.


Or try it on another function of your choice.

The key thing is to know the derivatives of your function f(x).

Note: A Maclaurin Series is a Taylor Series where a=0, so all the examples we have been
using so far can also be called Maclaurin Series.

Introduction to Integration
Integration is a way of adding slices to find the whole.

Integration can be used to find areas, volumes, central points and many useful things. But it is
easiest to start with finding the area under the curve of a function like this:

What is the area under y = f(x) ?

Slices

We could calculate the function at a few points and add up


slices of width x like this (but the answer won't be very
accurate):
We can make x a lot smaller and add up many small
slices (answer is getting better):

And as the slices approach zero in width, the answer


approaches thetrue answer.

We now write dx to mean the x slices are approaching zero in


width.

That is a lot of adding up!


But we don't have to add them up, as there is a "shortcut". Because ...

... finding an Integral is the reverse of finding a Derivative.

(So you should really know about Derivatives before reading more!)

Like here:

Example: What is an integral of 2x?

We know that the derivative of x2 is 2x ...


... so an integral of 2x is x2

You will see more examples later.

Notation

The symbol for "Integral" is a stylish "S"


(for "Sum", the idea of summing slices):

After the Integral Symbol we put the function we want to find the integral of (called the
Integrand),

and then finish with dx to mean the slices go in the x direction (and approach zero in width).

And here is how we write the answer:

Plus C
We wrote the answer as x2 but why + C ?

It is the "Constant of Integration". It is there because of all the functions whose derivative is
2x:

The derivative of x2+4 is 2x, and the derivative of x2+99 is also 2x, and so on! Because the
derivative of a constant is zero.

So when we reverse the operation (to find the integral) we only know 2x, but there could have
been a constant of any value.

So we wrap up the idea by just writing + C at the end.


Tap and Tank

Integration is like filling a tank from a tap.

The input (before integration) is the flow rate from the tap.

Integrating the flow (adding up all the little bits of water) gives us thevolume of water in the
tank.

Imagine the flow starts at 0 and gradually increases (maybe a motor is slowly opening the tap).

As the flow rate increases, the tank fills up faster and faster.

With a flow rate of 2x, the tank fills up at x2.

We have integrated the flow to get the volume.

Example: (assuming the flow is in liters per minute) after 3 minutes (x=3):

the flow rate has reached 2x = 23 = 6 liters/min,


and the volume has reached x2 = 32 = 9 liters.

We can do the reverse, too:

Imagine you don't know the flow rate.


You only know the volume is increasing by x2.

We can go in reverse (using the derivative, which gives us the slope) and find that the flow rate
is2x.

Example: at 2 minutes the slope of the volume is 4, meaning it is increasing at 4 liters/minute,


which is the flow rate. Likewise at 3 minutes the slope is 6, etc.
So Integral and Derivative are opposites.

We can write that down this way:

The integral of the flow rate 2x tells us the volume of water: 2x dx = x2 + C

And the slope of the volume increase x2+C gives us back the flow rate: (x2 + C) = 2x

And hey, we even get a nice explanation of that "C" value ... maybe the tank already has water
in it!

The flow still increases the volume by the same amount


And the increase in volume can give us back the flow rate.

Which teaches us to always add "+ C".

Other functions
Well, we have played with y=2x enough now, so how do we integrate other functions?

If we are lucky enough to find the function on the result side of a derivative, then (knowing that
derivatives and integrals are opposites) we have an answer. But remember to add C.

Example: what is cos(x) dx ?

From the Rules of Derivatives table we see the derivative of sin(x) is cos(x) so:

cos(x) dx = sin(x) + C

But a lot of this "reversing" has already been done (see Rules of Integration ).
Example: What is x3 dx ?
On Rules of Integration there is a "Power Rule" that says:

xn dx = xn+1/(n+1) + C
We can use that rule with n=3:

x3 dx = x4 /4 + C
Knowing how to use those rules is the key to being good at Integration.

So get to know those rules and get lots of practice.

Learn the Rules of Integration and Practice! Practice! Practice!


(there are some questions below)

Definite vs Indefinite Integrals


We have been doing Indefinite Integrals so far.

A Definite Integral has actual values to calculate between (they are put at the bottom and top
of the "S"):

Indefinite Integral Definite Integral

Read Definite Integrals to learn more.


Integration Rules

Integration
Integration can be used to find areas, volumes, central points
and many useful things. But it is often used to find the area
underneath the graph of a function like this:

The integral of many functions are well known, and there are useful rules to work out the
integral of more complicated functions, many of which are shown here.

There are examples below to help you.

Common Functions Function Integral

Constant a dx ax + C

Variable x dx x2/2 + C

Square x2 dx x3/3 + C

Reciprocal (1/x) dx ln|x| + C

Exponential ex dx ex + C

ax dx ax/ln(a) + C

ln(x) dx x ln(x) x + C

Trigonometry (x in radians) cos(x) dx sin(x) + C


sin(x) dx -cos(x) + C

sec2(x) dx tan(x) + C

Rules Function Integral

Multiplication by constant cf(x) dx cf(x) dx

Power Rule (n-1) xn dx xn+1/(n+1) + C

Sum Rule (f + g) dx f dx + g dx

Difference Rule (f - g) dx f dx - g dx

Integration by Parts See Integration by Parts

Substitution Rule See Integration by Substitution

Examples
Example: what is the integral of sin(x) ?

From the table above it is listed as being cos(x) + C

It is written as:

sin(x) dx = cos(x) + C

Power Rule

Example: What is x3 dx ?
The question is asking "what is the integral of x3 ?"

We can use the Power Rule, where n=3:


xn dx = xn+1/(n+1) + C
x3 dx = x4/4 + C
Example: What is x dx ?
x is also x0.5

We can use the Power Rule, where n=:

xn dx = xn+1/(n+1) + C
x0.5 dx = x1.5/1.5 + C

Multiplication by constant

Example: What is 6x2 dx ?


We can move the 6 outside the integral:

6x2 dx = 6x2 dx
And now use the Power Rule on x2:

= 6 x3/3 + C

Simplify:

= 2x3 + C

Sum Rule

Example: What is cos x + x dx ?


Use the Sum Rule:

cos x + x dx = cos x dx + x dx
Work out the integral of each (using table above):

= sin x + x2/2 + C
Difference Rule

Example: What is ew 3 dw ?
Use the Difference Rule:

ew 3 dw =ew dw 3 dw
Then work out the integral of each (using table above):

= ew 3w + C

Sum, Difference, Constant Multiplication And Power Rules

Example: What is 8z + 4z3 6z2 dz ?


Use the Sum and Difference Rule:

8z + 4z3 6z2 dz =8z dz + 4z3 dz 6z2 dz


Constant Multiplication:

= 8z dz + 4z3 dz 6z2 dz

Power Rule:

= 8z2/2 + 4z4/4 6z3/3 + C

Simplify:

= 4z2 + z4 2z3 + C

Integration by Parts

See Integration by Parts

Substitution Rule

See Integration by Substitution


Integration by Parts
Integration by Parts is a special method of integration that is often useful when two functions are
multiplied together, but is also helpful in other ways.

You will see plenty of examples soon, but first let us see the rule:

u v dx = uv dx u' (v dx) dx

u is the function u(x)


v is the function v(x)

As a diagram:

Let's get straight into an example, and talk about it after:

Example: What is x cos(x) dx ?


OK, we have x multiplied by cos(x), so integration by parts is a good choice.

First choose which functions for u and v:

u=x
v = cos(x)

So now it is in the format u v dx we can proceed:


Differentiate u: u' = x' = 1

Integrate v: v dx = cos(x) dx = sin(x) (see Integration Rules )

Now we can put it together:


Simplify and solve:

x sin(x) sin(x) dx
x sin(x) + cos(x) + C

So we followed these steps:

Choose u and v
Differentiate u: u'
Integrate v: v dx
Put u, u' and v dx into: uv dx u' (v dx) dx
Simplify and solve

In English, to help you remember, u v dx becomes:

(u integral v) minus integral of (derivative u, integral v)

Let's try some more examples:

Example: What is ln(x)/x2 dx ?


First choose u and v:

u = ln(x)
v = 1/x2

Differentiate u: ln(x)' = 1/x

Integrate v: 1/x2 dx = x-2 dx = x-1 = -1/x (by the power rule )


Now put it together:

Simplify:

ln(x)/x 1/x2 dx = ln(x)/x 1/x + C


(ln(x) + 1)/x + C

Example: What is ln(x) dx ?


But there is only one function! How do we choose u and v ?

Hey! We can just choose v as being "1":

u = ln(x)
v=1

Differentiate u: ln(x)' = 1/x

Integrate v: 1 dx = x
Now put it together:
Simplify:

x ln(x) 1 dx = x ln(x) x + C

Example: What is ex x dx ?
Choose u and v:

u = ex
v=x

Differentiate u: (ex)' = ex

Integrate v: x dx = x2/2
Now put it together:

Well, that was a spectacular disaster! It just got more complicated.

Maybe we could choose a different u and v?

Example: ex x dx (continued)
Choose u and v differently:

u=x
v = ex

Differentiate u: (x)' = 1

Integrate v: ex dx = ex
Now put it together:

Simplify:

x ex ex + C

ex(x1) + C

The moral of the story: Choose u and v carefully!

Choose a u that gets simpler when you differentiate it and a v that doesn't get any more
complicated when you integrate it.

A helpful rule of thumb is I LATE. Choose u based on which of these comes first:

I: Inverse trigonometric functions such as sin-1(x), cos-1(x), tan-1(x)


L: Logarithmic functions such as ln(x), log(x)
A: Algebraic functions such as x2, x3
T: Trigonometric functions such as sin(x), cos(x), tan (x)
E: Exponential functions such as ex, 3x

And here is one last (and tricky) example:

Example: ex sin(x) dx
Choose u and v:

u = sin(x)
v = ex

Differentiate u: sin(x)' = cos(x)


Integrate v: ex dx = ex
Now put it together:

ex sin(x) dx = sin(x) ex -cos(x) ex dx

Looks worse, but let us persist! We can use integration by parts again:

Choose u and v:

u = cos(x)
v = ex

Differentiate u: cos(x)' = -sin(x)

Integrate v: ex dx = ex
Now put it together:

ex sin(x) dx = sin(x) ex - (cos(x) ex sin(x) ex dx)


Simplify:

ex sin(x) dx = ex sin(x) - ex cos(x) ex sin(x)dx


Now we have the same integral on both sides (except one is subtracted) ...

... so bring the right hand one over to the left and we get:

2ex sin(x) dx = ex sin(x) ex cos(x)

Simplify:

ex sin(x) dx = ex (sin(x) - cos(x)) / 2 + C

Footnote: Where Did "Integration by Parts" Come From?


It is based on the Product Rule for Derivatives :

(uv)' = uv' + u'v

Integrate both sides and rearrange:

(uv)' dx = uv' dx + u'v dx


uv = uv' dx + u'v dx
uv' dx = uv u'v dx
Some people prefer that last form, but I like to integrate v' so the left side is simple:

uv dx = uv dx u'(v dx) dx

Integration by Substitution
"Integration by Substitution" (also called "u-substitution") is a method to find an integral , but
only when it can be set up in a special way.

The first and most vital step is to be able to write our integral in this form:

Note that we have g(x) and its derivative g'(x)

Like in this example:

Here f=cos, and we have g=x2 and its derivative of 2x


This integral is good to go!

When our integral is set up like that, we can do this substitution:


Then we can integrate f(u), and finish by putting g(x) back as u.

Like this:

Example: cos(x2) 2x dx
We know (from above) that it is in the right form to do the substitution:

Now integrate:

cos(u) du = sin(u) + C
And finally put u=x2 back again:

sin(x2) + C

So cos(x2) 2x dx = sin(x2) + C worked out really nicely! (Well, I knew it would.)

This method only works on some integrals of course, and it may need rearranging:

Example: cos(x2) 6x dx
Oh no! It is 6x, not 2x. Our perfect setup is gone.

Never fear! Just rearrange the integral like this:

cos(x2) 6x dx = 3cos(x2) 2x dx
(We can pull constant multipliers outside the integration, see Rules of Integration .)

Then go ahead as before:

3cos(u) du = 3 sin(u) + C

Now put u=x2 back again:

3 sin(x2) + C

Done!

Now we are ready for a slightly harder example:

Example: x/(x2+1) dx
Let me see ... the derivative of x2+1 is 2x ... so how about we rearrange it like this:

x/(x2+1) dx = 2x/(x2+1) dx
Then we have:

Then integrate:

1/u du = ln(u) + C

Now put u=x2+1 back again:

ln(x2+1) + C

And how about this one:


Example: (x+1)3 dx
Let me see ... the derivative of x+1 is ... well it is simply 1.

So we can have this:

(x+1)3 dx = (x+1)3 1 dx
Then we have:

Then integrate:

u3 du = (u4)/4 + C
Now put u=x+1 back again:

(x+1)4 /4 + C

So there you have it.

In Summary
When we can put an integral in this form:

Then we can make u=g(x) and integrate f(u) du


And finish up by re-inserting g(x) where u is.
Definite Integrals
You might like to read Introduction to Integration first!

Integration

Integration can be used to find areas, volumes, central points


and many useful things. But it is often used to find the area
under the graph of a function like this:

The area can be found by adding slices that approach zero in


width:

And there are Rules of Integration that help us get the answer.

Notation

The symbol for "Integral" is a stylish "S"


(for "Sum", the idea of summing slices):

After the Integral Symbol we put the function we want to find the integral of (called the
Integrand),

and then finish with dx to mean the slices go in the x direction (and approach zero in width).

Definite Integral
A Definite Integral has start and end values: in other words there is an interval (a to b).

The values are put at the bottom and top of the "S", like this:

Indefinite Integral Definite Integral


(no specific values) (from a to b)

We can find the Definite Integral by calculating the Indefinite Integral at points a and b, then
subtracting:

Example:

The Definite Integral, from 1 to 2, of 2x dx:

The Indefinite Integral is: 2x dx = x2 + C

At x=1: 2x dx = 12 + C
At x=2: 2x dx = 22 + C
Subtract:

(22 + C) (12 + C)

22 + C 12 C

41+ CC =3

And "C" gets cancelled out ... so with Definite Integrals we can ignore C.

In fact we can give the answer directly like this:

We can check that, by calculating the area of the shape:

Yes, it has an area of 3.

(Yay!)

Let's try another example:

Example:

The Definite Integral, from 0.5 to 1.0, of cos(x) dx:


(Note: x must be in radians )

The Indefinite Integral is: cos(x) dx = sin(x) + C

We can ignore C when we do the subtraction (as we saw above):

= sin(1) sin(0.5)

= 0.841... 0.479...

= 0.362...

And another example to make an important point:

Example:

The Definite Integral, from 0 to 1, of sin(x) dx:

The Indefinite Integral is: sin(x) dx = cos(x) + C

Since we are going from 0, can we just calculate the area at x=1?

cos(1) = 0.540...

What? The Area at x=1 is negative? No, we need to subtract the integral at x=0. We
shouldn't assume that it is zero.
So let us do it properly, subtracting one from the other (and C gets cancelled so we don't need to
show it):

= cos(1) (cos(0))

= 0.540... (1)

= 0.460...

That's better!

But we can have negative areas, when the curve is below the axis:

Example:

The Definite Integral, from 1 to 3, of cos(x) dx:

Notice that some of it is positive, and some negative.


The definite integral will work out the net area.

The Indefinite Integral is:cos(x) dx = sin(x) + C

So let us do the calculations:

= sin(3) sin(1)

= 0.141... 0.841...
= 0.700...

Try integrating cos(x) with different start and end values to see for yourself how positives and
negatives work.

But sometimes you want the actual area (without the part below being subtracted):

Example: What is the area between y = cos(x) and the x-axis from x = 1 to x
= 3?

This is like the example we just did, but area is positive(imagine you had to paint it).

So now we have to do the parts separately:

One for the area above the x-axis


One for the area below the x-axis

The curve crosses the x-axis at x = /2 so we have:

/2

cos(x) dx = sin(/2) sin(1)

= 1 0.841...

= 0.159...


/2
cos(x) dx = sin(3) sin(/2)

= 0.141... 1

= 0.859...

That last one comes out negative, but we want positive, so:

Total area = 0.159... + 0.859... = 1.018...

This is very different from the answer in the previous example.

Continuous
Oh yes, the function we are integrating must be Continuous between a and b: no holes, jumps
or vertical asymptotes (where the function heads up/down towards infinity).

Example:

A vertical asymptote between a and b affects the definite integral.

Properties

Reversing the interval

Reversing the direction of the interval gives the negative of the original direction.
Interval of zero length

When the interval starts and ends at the same place, the result is zero:

Adding intervals

We can also add two adjacent intervals together:

Summary
The Definite Integral between a and b is the Indefinite Integral at b minus the Indefinite Integral
at a.

Arc Length
Using Calculus to find the length of a curve.
(Please read about Derivatives and Integrals first)

Imagine we want to find the length of a curve between two points. And the curve is smooth (the
derivative is continuous ).

First we break the curve into small lengths and use the Distance Between 2 Points formula on
each length to come up with an approximate answer:

The distance from x0 to x1 is:

S1 = (x1 x0) + (y1 y0)

And let's use (delta) to mean the difference between values, so it becomes:

S1 = (x1) + (y1)

Now we just need lots more:

S2 = (x2) + (y2)
S3 = (x3) + (y3)
...
...
Sn = (xn) + (yn)
We can write all those many lines in just one line using a Sum :


i=1

(xi) + (yi)

But we are still doomed to a large number of calculations!

Maybe we can make a big spreadsheet, or write a program to do the calculations ... but lets try
something else.

We have a cunning plan:

have all the xi be the same so we can extract them from inside the square root
and then turn the sum into an integral.

Let's go:

First, divide and multiply yi by xi:


i=1

(xi) + (xi)(yi/xi)

Now factor out (xi):


S


i=1

(xi)(1 + (yi/xi))

Take (xi) out of the square root:


i=1

1 + (yi/xi) xi

Now, as n approaches infinity (as we head towards an infinite number of slices, and each slice
gets smaller) we get:

S=

lim
n


i=1

1 + (yi/xi) xi

We now have an integral and we write dx to mean the x slices are approaching zero in width
(likewise for dy):

S=

1 + (dy/dx) dx

And dy/dx is the derivative of the function f(x), which can also be written f(x):

S=

1 + (f(x)) dx

The Arc Length Formula

And now suddenly we are in a much better place, we don't need to add up lots of slices, we can
calculate an exact answer (if we can solve the differential and integral).

Note: the integral also works with respect to y, useful if we happen to know x=g(y):
S=

1 + (g(y)) dy

So our steps are:

Find the derivative of f(x)


Solve the integral of 1 + (f(x)) dx

Some simple examples to begin with:

Example: Find the length of f(x) = 2 between x=2 and x=3

f(x) is just a horizontal line, so its derivative is f(x) = 0

S=

Start with:
2

1 + (f(x)) dx
S=

Put in f(x) = 0:
2

1 + (0) dx

S=

Simplify:
2

dx

Calculate the Integral: S = (3-2) = 1

So the arc length between 2 and 3 is 1. Well of course it is, but it's nice that we came up with
the right answer!

Interesting point: the "(1 + ...)" part of the Arc Length Formula guarantees we get at leastthe
distance between x values, such as this case where f(x) is zero.
Example: Find the length of f(x) = x between x=2 and x=3

The derivative f(x) = 1

S=

Start with:
2

1 + (f(x)) dx

S=

Put in f(x) = 1:
2

1 + (1) dx

S=

Simplify:

2
2 dx

S = 2

Simplify more:

2

dx

Calculate the Integral: S = 2(3-2) = 2

And the diagonal across a unit square really is the square root of 2, right?

OK, now for the harder stuff. And this is useful, too:

Example: Metal posts have been installed 6m apart across a gorge.

Find the length for the hanging bridge that follows the curve:

f(x) = 5 cosh(x/5)

Here is the actual curve:


Let us solve the general case first!

A hanging cable forms a curve called a catenary:

f(x) = a cosh(x/a)

Larger values of a have less sag in the middle


And "cosh" is the hyperbolic cosine function.

The derivative is: f(x) = sinh(x/a)

The curve is symmetrical, so it is easier to work on half of the catenary, from the center to an
end at "b":

S=

Start with:
0

1 + (f(x)) dx

S=

Put in f(x) = sinh(x/a): b

1 + sinh(x/a) dx

S=

Use the identity


1 + sinh(x/a) = cosh(x/a):
0

cosh(x/a) dx

S=

Simplify:
0

cosh(x/a) dx

Calculate the Integral: S = a sinh(b/a)

Now, remembering the symmetry, let's go from b to +b:

S = 2a sinh(b/a)

In our specific case a=5 and the 6m span goes from 3 to +3

S = 25 sinh(3/5)
= 6.367 m (to nearest mm)
This is important to know! If we build it exactly 6m in length there is no way we could pull it
hard enough for it to meet the posts. But at 6.367m it will work nicely.

Example: Find the length of y = x(3/2) from x = 0 to x = 4.

The derivative is y = (3/2)x(1/2)

S=

Start with:
0

1 + (f(x)) dx

S=

Put in (3/2)x(1/2): 4

1 + ((3/2)x(1/2)) dx

S=

Simplify:
0

1 + (9/4)x dx

We can use integration by substitution :

u = 1 + (9/4)x
du = (9/4)dx
(4/9)du = dx
Bounds: u(0)=1 and u(4)=10
S=

10

And we get:
1

(4/9) u du

Integrate: S = (8/27) u(3/2) from 1 to 10


Calculate: S = (8/27) (10(3/2) - 1(3/2)) = 9.073...

Conclusion
The Arc Length Formula is:

S=

1 + (f(x)) dx

Steps:

Take derivative of f(x)


Write Arc Length Formula
Simplify and solve integral

Integral Approximations
Integration is the best way to find the area from a curve to the axis: we get a formula for
an exact answer.

But Integration can sometimes be hard or impossible to do!

Don't worry though, because we can add up lots of slices


to get an approximate answer.

Let's have a go!

Examples
Let's use f(x) = ln(x) from x = 1 to x = 4

We actually can integrate that and get the true answer of 2.54517744447956....

But imagine we can't, and the only thing we can do is calculate values of ln(x):

at x=1: ln(1) = 0
at x=2: ln(2) = 0.693147...
etc

Let's use a slice width of 1 to make it easy to see what is going on (but smaller slices are
better).

The first 4 methods are also called Riemann Sums after the mathematician Bernhard
Riemann.
Left Rectangular Approximation Method (LRAM)

This method uses rectangles whose height is the left-most value. Areas are:

x=1 to 2: ln(1) 1 = 0 1 = 0
x=2 to 3: ln(2) 1 = 0.693147... 1 = 0.693147...
x=3 to 4: ln(3) 1 = 1.098612... 1 = 1.098612...

Adding these up gets 1.791759, much lower than 2.545177. Why?

Because we are missing all that area between the tops of the rectangles and the curve.

This is made worse by a curve that is constantly increasing. When a curve goes up and down
more, the error is usually less.

Right Rectangular Approximation Method (RRAM)

Now the rectangles height is the right-most value. Areas are:

x=1 to 2: ln(2) 1 = 0.693147... 1 = 0.693147...


x=2 to 3: ln(3) 1 = 1.098612... 1 = 1.098612...
x=3 to 4: ln(4) 1 = 1.386294... 1 = 1.386294...

Adding these up gets 3.178054, which is now much higher than 2.545177, because we have
included areas between the tops of the rectangles and the curve.
Midpoint Rectangular Approximation Method (MRAM)

We can also use the midpoint! Areas are:

x=1 to 2: ln(1.5) 1 = 0.405465... 1 = 0.405465...


x=2 to 3: ln(2.5) 1 = 0.916291... 1 = 0.916291...
x=3 to 4: ln(3.5) 1 = 1.252763... 1 = 1.252763...

Adding these up gets 2.574519..., which is quite close to 2.545177.

Trapezoidal Rule

We can use both sides for a triangular effect at the top, which usually make trapezoids.

The calculation just averages the left and right values. Areas are:

x=1 to 2: ln(1) + ln(2)2 1 = 0 + 0.693147...2 1 = 0.346573...


x=2 to 3: ln(2) + ln(3)2 1 = 0.693147... + 1.098612...2 1 = 0.895879...
x=3 to 4: ln(3) + ln(4)2 1 = 1.098612... + 1.386294...2 1 = 1.242453...

Adding these up gets 2.484907, which is still a bit lower than 2.545177, mostly because the
curve is concave down over the interval.

Notice that in practice each value gets used twice (except first and last) and then the whole sum
is divided by 2:

ln(1) + ln(2)2 1 + ln(2) + ln(3)2 1 + ln(3) + ln(4)2 1


12 ( ln(1) + ln(2) + ln(2) + ln(3) + ln(3) + ln(4) )
12 ( ln(1) + 2 ln(2) + 2 ln(3) + ln(4) )

So we can have a general formula:

x2 ( f(x0) + 2f(x1) + 2f(x2) + ... 2f(xn-1) + f(xn) )

By the way, this method is just the average of the Left and Right Methods:

Trapezoidal Approximation = LRAM + RRAM2

Simpson's Rule

An improvement on the Trapezoidal Rule is Simpson's Rule. It is based on using parabolas at the
top instead of straight lines. The parabolas often get quite close to the real curve:
It sounds hard, but we end up with a formula like the trapezoid formula (but we divide by 3 and
use a 4,2,4,2,4 pattern of factors):

x3 ( f(x0) + 4f(x1) + 2f(x2) + ... 4f(xn-1) + f(xn) )

But: n must be even. So let's take 6 slices of 0.5 each:

0.53 ( f(1) + 4f(1.5) + 2f(2) + 4f(2.5) + 2f(3) + 4f(3.5) + f(4) )

Plugging in values of ln(1) etc gives:

0.53 ( 15.2679... )
2.544648...

This is a great result when compared to 2.545177....

Plus and Minus

Note that when the curve is below the axis the area is negative.

Error and Accuracy


Let's compare them all:

f(x)=ln(x) N=3 N=6 N = 100

Estimation Error Estimation Error Estimation Error

LRAM 1.791759 0.753418 2.183140 0.362037 2.524327 0.020850

RRAM 3.178054 -0.632877 2.876287 -0.331110 2.565916 -0.020739


MRAM 2.574519 -0.029342 2.552851 -0.007674 2.545206 -0.000029

Trapezoidal Rule 2.484907 0.060271 2.529713 0.015464 2.545121 0.000055

Simpsons Rule (N must be even) 2.544648 0.000529 2.545177 <0.000001

Simpsons Rule rules! And it is just as easy to use as the others.

Of course a different function will produce different results. Why not try one yourself?

Maximum Error
In practice we won't know the actual answer ... so how do we know how good our estimate is?

You can get a good feel by trying different slice widths.

And there are also these formulas for the maximum error of approximation (these are for the
worst case and the actual error will hopefully be a lot smaller):

For Midpoint: |E| = K(b-a)324n2


For Trapezoidal: |E| = K(b-a)312n2
For Simpson's: |E| = M(b-a)5180n4

Where:

|E| is the absolute value of the maximum error (could be plus or minus)
a is the start of the interval
b is the end of the interval
n is the number of slices
K is the greatest second derivative over the interval.
M is the greatest fourth derivative over the interval.

(By "greatest" we mean the maximum absolute value.)

a, b and n are easy, but how do we find K and M ?

Example: f(x) = ln(x) between 1 and 4

Let's find some derivatives first, we will need them:

1st derivative: f'(x) = 1/x


2nd derivative: f''(x) = 1/x2
3rd derivative: f(3)(x) = 2/x3
4th derivative: f(4)(x) = 6/x4
5th derivative: f(5)(x) = 24/x5

The greatest K could be at the start, end, or somewhere in between:

Start: f''(1) = 1/12 = 1


End: f''(4) = 1/42 = 1/16
In between: use the 3rd derivative to see if there are zeros in the 1 to 4 interval, which could
mean a change in direction.
Does f(3)(x) = 0 between 1 and 4? No. So the maximum is at start or end.

So K = 1 (the maximum absolute value)

Same for M, but higher derivatives:

Start: f(4)(1) = 6/14 = 6


End: f(4)(4) = 6/44= 6/256
In between: use the 5th derivative to see if there are zeros in the 1 to 4 interval.
Does f(5)(x) = 24/x5 equal zero between 1 and 4? No.

So M = 6 (the maximum absolute value)

For just 6 slices, the Maximum Errors are:

Midpoint: |E| = 1(4-1)32462 = 0.03125


Trapezoidal: |E| = 1(4-1)31262 = 0.0625
Simpson's: |E| = 6(4-1)518064 = 0.00625

Shapes we Know
The curve may have a shape we know, and we can use geometry formulas like these examples:
Example: Triangle

f(x) = 2 x, from 0 to 2

A=22=2

Example: Rectangle

f(x) = 2, from 0 to 3

A=23=6

Example: Semicircle

f(x) = (1 x2), from 1 to +1

A= r2 / 2 = / 2

Conclusion
We can estimate the area under a curve by slicing a function up

There are many ways of finding the area of each slice such as:

Left Rectangular Approximation Method (LRAM)


Right Rectangular Approximation Method (RRAM)
Midpoint Rectangular Approximation Method (MRAM)
Trapezoidal Rule
Simpson's Rule

We can use error formulas to find the largest possible error in our estimate

Basic geometry formulas can sometimes help us find areas under the curve

Solids of Revolution by Disks


We can have a function, like this one:

And revolve it around the x-axis like this:

To find its volume we can add up a series of disks:

Each disk's face is a circle:

The area of a circle is times radius squared:

A= r2
And the radius r is the value of the function at that point f(x), so:
A= f(x)2
And the volume is found by summing all those disks using Integration :

Volume =

f(x)2 dx

And that is our formula for Solids of Revolution by Disks

In other words, to find the volume of revolution of a function f(x): integrate pi times the
square of the function.

Example: A Cone

Take the very simple function y=x between 0 and b

Rotate it around the x-axis ... and we have a cone!

The radius of any disk is the function f(x), which in our case is simply x

What is its volume? Integrate pi times the square of the function x :

Volume =
b

(x)2 dx

First, let's have our pi outside (yum).

Seriously, it is OK to bring a constant outside the integral:

Volume =

x2 dx

Using Integration Rules we find the integral of x2 is x3/3 + C

To calculate this definite integral , we calculate the value of that function for b and for 0 and
subtract, like this:

Volume = (b3/3 03/3)

= b3/3

Compare that result with the more general volume of a cone:


Volume = 13 r2 h

When both r=b and h=b we get:

Volume = 13 b3

As an interesting exercise, why not try to work out the more general case of any value of r and h
yourself?

We can also rotate about other lines, such as x = 1

Example: Our Cone, But About x = 1

So we have this:

Rotated about x = 1 it looks like this:

The cone is now bigger, with its sharp end cut off (a truncated cone)

Let's draw in a sample disk so we can work out what to do:

OK. Now what is the radius? It is our function y=x plus an extra 1:

y=x+1

Then integrate pi times the square of that function:

Volume =


0
(x+1)2 dx

Pi outside, and expand (x+1)2 to x2+2x+1 :

Volume =

(x2+2x+1) dx

Using Integration Rules we find the integral of x2+2x+1 is x3/3 + x2 + x + C

And going between 0 and b we get:

Volume = (b3/3+b2+b (03/3+02+0))

= (b3/3+b2+b)

Now for another type of function:

Example: The Square Function

Take y = x2 between x=0.6 and x=1.6

Rotate it around the x-axis:

What is its volume? Integrate pi times the square of x2:

Volume =
1.6


0.6

(x2)2 dx

Simplify by having pi outside, and also (x2)2 = x4 :

Volume =

1.6


0.6

x4 dx

The integral of x4 is x5/5 + C

And going between 0.6 and 1.6 we get:

Volume = ( 1.65/5 0.65/5 )

6.54

Can you rotate y = x2 about x = 1 ?

In summary:
Have pi outside
Integrate the function squared
Subtract the lower end from the higher end

About The Y Axis


We can also rotate about the Y axis:

Example: The Square Function

Take y=x2, but this time using the y-axis between y=0.4 and y=1.4

Rotate it around the y-axis:

And now we want to integrate in the y direction!

So we want something like x = g(y) instead of y = f(x). In this case it is:

x = (y)

Now integrate pi times the square of (y)2 (and dx is now dy):

Volume =

1.4


0.4

(y)2 dy

Simplify with pi outside, and (y)2 = y :

Volume =

1.4


0.4

y dy

The integral of y is y2/2

And lastly, going between 0.4 and 1.4 we get:

Volume = ( 1.42/2 0.42/2 )

2.83...

Washer Method

Washers: Disks with Holes

What if we want the volume between two functions?


Example: Volume between the functions y=x and y=x3 from x=0 to 1

These are the functions:

Rotated around the x-axis:

The disks are now "washers":

And they have the area of an annulus :

In our case R = x and r = x3

In effect this is the same as the disk method, except we subtract one disk from another.

And so our integration looks like:

Volume =

(x)2 (x3)2 dx

Have pi outside (on both functions):

Volume =
1

(x)2 (x3)2 dx

Simplify:

Volume =

x2 x6 dx

The integral of x2 is x3/3 and the integral of x6 is x7/7

And so, going between 0 and 1 we get:

Volume = [ (13/3 17/7 ) (00) ]

0.598...

So the Washer method is like the Disk method, but with the inner disk subtracted from the outer
disk.

Differential Equations
A Differential Equation is an equation with a function and one or more of its derivatives :
Example: an equation with the function y and its derivative dydx

Solving
We solve it when we discover the function y (or set of functions y).

There are many "tricks" to solving Differential Equations (if they can be solved!), but first: why?

Why Are Differential Equations Useful?


In our world things change, and describing how they change often ends up as a Differential
Equation:

Example: Rabbits!

The more rabbits we have the more baby rabbits we get. Then those rabbits grow up and have
babies too! The population will grow faster and faster.

The important parts of this are:

the population N at any time t


the growth rate r

the population's rate of change N

Let us imagine some actual values:

the population N is 1000


the growth rate r is 0.01 new rabbits per week for every current rabbit

The population's rate of change N is then 10000.01 = 10 new rabbits per week.
But that is only true at a specific time, and doesn't include that the population is constantly
increasing.

Remember: the bigger the population, the more new rabbits we get!

So it is better to say the rate of change (at any instant) is the growth rate times the population
at that instant:

dN
= rN
dt

And it is a Differential Equation, because it has a function N(t) and its derivative.

And how powerful mathematics is! That short equation says "the rate of change of the population
over time equals the growth rate times the population".

Differential Equations can describe how populations change, how heat moves, how springs
vibrate, how radioactive material decays and much more. They are a very natural way to
describe many things in the universe.

What To Do With Them?


On its own, a Differential Equation is a wonderful way to express something, but is hard to use.

So we try to solve them by turning the Differential Equation into a simpler Algebra-style
equation (without the differential bits) so we can do calculations, make graphs, predict the
future, and so on.
Example: Compound Interest

Money earns interest. The interest can be calculated at fixed times, such as yearly, monthly, etc.
and added to the original amount.

This is called compound interest .

But when it is compounded continuously then at any time the interest gets added in proportion
to the current value of the loan (or investment).

And the bigger the loan the more interest it earns.

Using t for time, r for the interest rate and V for the current value of the loan:

dV
= rV
dt

And here is a cool thing: it is the same as the equation we got with the Rabbits! It just has
different letters. So mathematics shows us these two things behave the same.

Solving

The Differential Equation says it well, but is hard to use.

But don't worry, it can be solved (using a special method called Separation of Variables ) and
results in:

V = Pert

Where P is the Principal (the original loan).

So a continuously compounded loan of $1,000 for 2 years at an interest rate of 10% becomes:

V = 1000 e(20.1)

V = 1000 1.22140...
= $1,221.40 (to nearest cent)
So Differential Equations are great at describing things, but need to be solved to be useful.

More Examples of Differential Equations

The Verhulst Equation

Example: Rabbits Again!

Remember our growth Differential Equation:

dN
= rN
dt

Well, that growth can't go on forever as they will soon run out of available food.

So let's improve it by including:

the maximum population that the food can support k

A guy called Verhulst figured it all out and got this Differential Equation:

dN
= rN(1-N/k)
dt

The Verhulst Equation

Simple harmonic motion

In Physics, Simple Harmonic Motion is a type of periodic motion where the restoring force is
directly proportional to the displacement. An example of this is given by a mass on a spring.
Example: Spring and Weight

A spring gets a weight attached to it:

the weight is pulled down by gravity,


the tension in the spring increases as it stretches,
then the spring bounces back up,
then back down, up and down, again and again.

Describe this with mathematics!

The weight is pulled down by gravity, and we know from Newton's Second Law that force
equals mass times acceleration:

F = ma

And acceleration is the second derivative of position with respect to time, so:

F = m d2xdt2

The spring pulls it back up based on how stretched it is (k is the spring's stiffness, and xis how
stretched it is): F = -kx

The two forces are always equal:

m d2xdt2 = kx

We have a differential equation!

It has a function x(t), and it's second derivative d2xdt2

Note: we haven't included "damping" (the slowing down of the bounces due to friction), that is
just a little more complicated.
OK, now we want to solve it to find how the spring bounces up and down over time.

Classify Before Trying To Solve


OK, we want to solve them, but how?

Over the years wise people have worked out special methods to solve some typesof
Differential Equations.

So we need to know what type of Differential Equation it is first.

It is like travel: different kinds of transport have solved how to get to certain places.Is it near, so
we can just walk? Is there a road so we can take a car? Is it over water so we need a ship? Or is
it in another galaxy and we just can't get there yet?

So let us classify the Differential Equation.

Ordinary or Partial

The first major grouping is:

"Ordinary Differential Equations" (ODEs) have a single independent variable (like y)


"Partial Differential Equations" (PDEs) have two or more independent variables.

We are learning about Ordinary Differential Equations here!


Order and Degree

Next we work out the Order and the Degree:

Order

The Order is the highest derivative (is it a first derivative? a second derivative ? etc):

Example:
dy
+ y2 = 5x
dx

It has only the first derivative dydx , so is "First Order"

Example:
d2y
+ xy = sin(x)
dx2

This has a second derivative d2ydx2 , so is "Order 2"

Example:
d3y dy
+x + y= ex
dx3 dx

This has a third derivative d3ydx3 which outranks the dydx , so is "Order 3"

Degree

The degree is the exponent of the highest derivative.

Example:
dy
( )2 + y = 5x2
dx

The highest derivative is just dy/dx, and it has an exponent of 2, so this is "Second Degree"
In fact it is a First Order Second Degree Ordinary Differential Equation

Example:
d3y dy
+( )2 + y = 5x2
3
dx dx

The highest derivative is d3y/dx3, but it has no exponent (well actually an exponent of 1 which is
not shown), so this is "First Degree".

(The exponent of 2 on dy/dx does not count, as it is not the highest derivative).

So it is a Third Order First Degree Ordinary Differential Equation

Be careful not to confuse order with degree. Some people use the word order when
they mean degree!

Linear

It is Linear when the variable (and its derivatives) has no exponent or other function put on it.

So no y2, y3, y, sin(y), ln(y) etc, just plain y (or whatever the variable is).

More formally a Linear Differential Equation is in the form:

dy
+ P(x)y = Q(x)
dx

Solving
OK, we have classified our Differential Equation, the next step is solving.

This is not a complete list of how to solve differential equations, but it should get you started:

Separation of Variables
Solving First Order Linear Differential Equations
Homogeneous Differential Equations
Separation of Variables
Separation of Variables is a special method to solve some Differential Equations

A Differential Equation is an equation with a function and one or more of its derivatives :

Example: an equation with the function y and its derivative dydx

When Can I Use it?

Separation of Variables can be used when:

All the y terms (including dy) can be moved to one side of the equation, and

All the x terms (including dx) to the other side.

Method
Three Steps:

Step 1 Move all the y terms (including dy) to one side of the equation and all the x terms
(including dx) to the other side.
Step 2 Integrate one side with respect to y and the other side with respect to x. Don't forget
"+ C" (the constant of integration).
Step 3 Simplify

Example: Solve this (k is a constant)


dydx = ky

Step 1 Separate the variables by moving all the y terms to one side of the equation and all the x
terms to the other side.

Multiply both sides by dx: dy = ky dx

Divide both sides by y: dyy = k dx

Step 2 Integrate both sides of the equation separately:


Put the integral sign in front: dyy = k dx
Integrate left side: ln(y) + C = k dx

Integrate right side: ln(y) + C = kx + D

C is the constant of integration. And we use D for the other, as it is a different constant.

Step 3 Simplify

We can roll the two constants into one (a=DC): ln(y) = kx + a

e(ln(y)) = y , so let's take exponents on both sides: y = ekx + a

And ekx + a = ekx ea so we get: y = ekx ea

ea is just a constant so we replace it with c y = cekx

We have solved it:

y = cekx

This is a general type of first order differential equation which turns up in all sorts of unexpected
places in real world examples.

We used y and x, but the same method works for other variable names, like this:

Example: Rabbits!

The more rabbits you have the more baby rabbits you will get. Then those rabbits grow up and
have babies too! The population will grow faster and faster.

The important parts of this are:


the population N at any time t
the growth rate r
the population's rate of change dNdt

The rate of change at any time equals the growth rate times the population:

dNdt = rN

But hey! This is the same as the equation we just solved! It just has different letters:

N instead of y
t instead of x
r instead of k

So we can jump to a solution:

N = cert

And here is an example, the graph of N = 0.3e2t:

Exponential Growth

There are other equations that follow this pattern such as continuous compound interest .

More Examples
OK, on to some different examples of separating the variables:
Example: Solve this
dy 1
=
dx y

Step 1 Separate the variables by moving all the y terms to one side of the equation and all the x
terms to the other side.

Multiply both sides by dx: dy = (1/y) dx

Multiply both sides by y: y dy = dx

Step 2 Integrate both sides of the equation separately:

Put the integral sign in front: y dy = dx


Integrate each side: (y2)/2 = x + C

We integrated both sides in the one line.

We also used a shortcut of just one constant of integration C. This is perfectly OK as we could
have +D on one, +E on the other and just say that C = ED.

Step 3 Simplify

Multiply both sides by 2: y2 = 2(x + C)

Square root of both sides: y = (2(x + C))

Note: This is not the same as y = (2x) + C, because the C was added before we took the
square root. This happens a lot with differential equations. We cannot just add the C at the end
of the process. It is added when doing the integration.

We have solved it:

y = (2(x + C))
A harder example:

Example: Solve this


dy 2xy
=
dx 1 + x2

Step 1 Separate the variables

1 2x
Multiply both sides by dx, divide both sides by y: dy = dx
y 1+ x2

Step 2 Integrate both sides of the equation separately:

1 2x
Put the integral sign in front: dy = dx
y 1+ x2

The left side is a simple logarithm, the right side can be integrated using substitution:

1 1
Let u = 1 + x2, so du = 2x dx dy = du
y u

Integrate: ln(y) = ln(u) + C

Then we make C = ln(k): ln(y) = ln(u) + ln(k)

So we can get this: y = uk

Now put u = 1 + x2 back again: y = k(1 + x2)

Step 3 Simplify
It is already as simple as can be. We have solved it:

y = k(1 + x2)

An even harder example: the famous Verhulst Equation

Example: Rabbits Again!

Remember our growth Differential Equation:

dN
= rN
dt

Well, that growth can't go on forever as they will soon run out of available food.

A guy called Verhulst included k (the maximum population the food can support) to get:

dN
= rN(1-N/k)
dt

The Verhulst Equation

Can this be solved?

Yes, with the help of one trick ...

Step 1 Separate the variables


Multiply both sides by dt: dN = rN(1N/k) dt

1
Divide both sides by N(1-N/k): dN = r dt
N(1N/k)

Step 2 Integrate

1
Put the integral sign in front: dN = r dt
N(1N/k)

Hmmm... the left side looks hard to integrate. In fact it can be done, with a little trick.

1
We start with this:
N(1N/k)

k
Multiply top and bottom by k:
N(kN)

N+kN
Now here is the trick, add N and N to the top
(see Partial Fractions):
N(kN)

N kN
and split it into two fractions: +
N(kN) N(kN)

1 1
Simplify each fraction: +
kN N

They can be integrated separately now, like this:

1 dN + 1 dN = r dt
kN N

Integrate: ln(kN) + ln(N) = rt + C

Done!

(Why did that become minus ln(kN)? Because we are integrating with respect to N.)

Step 3 Simplify

Negative of all terms: ln(kN) ln(N) = rt C

Combine ln(): ln((kN)/N) = rt C

Now take exponents on both sides: (kN)/N = ertC

Separate the powers of e: (kN)/N = ert eC

eC is a constant, we can replace it with A: (kN)/N = Aert

We are getting close! Just a little more algebra to get N on its own:

Separate the fraction terms: (k/N)1 = Aert

Add 1 to both sides: k/N = 1 + Aert

Divide both by k: 1/N = (1 + Aert)/k

Reciprocal of both sides: N = k/(1 + Aert)

And we have our solution:

k
N=
1 + Aert
40
And here is an example, the graph of :
2t
1 + 5e

It starts rising exponentially,


then flattens out as it reaches k=40

Solution of First Order Linear Differential Equations


You might like to read about Differential Equations and Separation of Variables first!

A Differential Equation is an equation with a function and one or more of its derivatives :

Example: an equation with the function y and its derivative dydx

Here we will look at solving a special class of Differential Equations called First Order Linear
Differential Equations

First Order
They are "First Order" when there is only dydx , not d2ydx2 or d3ydx3 etc

Linear
A first order differential equation is linear when it can be made to look like this:
dy
+ P(x)y = Q(x)
dx

Where P(x) and Q(x) are functions of x.

To solve it there is a special method:

We invent two new functions of x, call them u and v, and say that y=uv.
We then solve to find u, and then find v, and tidy up and we are done!

And we also use the derivative of y=uv (see Derivative Rules (Product Rule) ):

dy dv du
= u + v
dx dx dx

Steps
Here is a step-by-step method for solving them:

1. Substitute y = uv, and

dy dv du
= u + v
dx dx dx

into

dy
+ P(x)y = Q(x)
dx

2. Factor the parts involving v


3. Put the v term equal to zero (this gives a differential equation in u and x which can be
solved in the next step)
4. Solve using separation of variables to find u
5. Substitute u back into the equation we got at step 2
6. Solve that to find v
7. Finally, substitute u and v into y = uv to get our solution!

Let's try an example to see:

Example: Solve this:


dydx yx = 1

First, is this linear? Yes, as it is in the form

dydx + P(x)y = Q(x)


where P(x) = 1x and Q(x) = 1

So let's follow the steps:

Step 1: Substitute y = uv, and dydx = u dvdx + v dudx


So this: dydx yx = 1

Becomes this: u dvdx + v dudx uvx = 1

Step 2: Factor the parts involving v

Factor v: u dvdx + v( dudx ux ) = 1

Step 3: Put the v term equal to zero

v term = zero: dudx ux = 0

So: dudx = ux

Step 4: Solve using separation of variables to find u

Separate variables: duu = dxx

Put integral sign: duu = dxx


Integrate: ln(u) = ln(x) + C

Make C = ln(k): ln(u) = ln(x) + ln(k)

And so: u = kx

Step 5: Substitute u back into the equation at Step 2


(Remember v term equals 0 so can be ignored): kx dvdx = 1

Step 6: Solve this to find v

Separate variables: k dv = dxx

Put integral sign: k dv = dxx


Integrate: kv = ln(x) + C

Make C = ln(c): kv = ln(x) + ln(c)

And so: kv = ln(cx)

And so: v = 1k ln(cx)

Step 7: Substitute into y = uv to find the solution to the original equation.

y = uv: y = kx 1k ln(cx)

Simplify: y = x ln(cx)

And it produces this nice family of curves:

y = x ln(cx) for various values of c

What is the meaning of those curves? They are the solution to the equation dydx yx = 1

In other words:

Anywhere on any of those curves


the slope minus yx equals 1

Let's check a few points on the c=0.6 curve:

Estmating off the graph (to 1 decimal place):

Point x y Slope (dydx) dydx yx


A 0.6 0.6 0 0 0.60.6 = 0 + 1 = 1

B 1.6 0 1 1 01.6 = 1 0 = 1

C 2.5 1 1.4 1.4 12.5 = 1.4 0.4 = 1

Why not test a few points yourself? You can plot the curve here .

Perhaps another example to help you? Maybe a little harder?

Example: Solve this:


dydx 3yx = x

First, is this linear? Yes, as it is in the form

dydx + P(x)y = Q(x)


where P(x) = 3x and Q(x) = x

So let's follow the steps:

Step 1: Substitute y = uv, and dydx = u dvdx + v dudx


So this: dydx 3yx = x

Becomes this: u dvdx + v dudx 3uvx = x

Step 2: Factor the parts involving v

Factor v: u dvdx + v( dudx 3ux ) = x

Step 3: Put the v term equal to zero

v term = zero: dudx 3ux = 0

So: dudx = 3ux

Step 4: Solve using separation of variables to find u

Separate variables: duu = 3 dxx


Put integral sign: duu = 3 dxx
Integrate: ln(u) = 3 ln(x) + C

Make C = ln(k): ln(u) + ln(k) = 3ln(x)

Then: uk = x3

And so: u = x3k

Step 5: Substitute u back into the equation at Step 2

(Remember v term equals 0 so can be ignored): ( x3k ) dvdx = x

Step 6: Solve this to find v

Separate variables: dv = k x2 dx

Put integral sign: dv = k x2 dx


Integrate: v = k x1 + D

Step 7: Substitute into y = uv to find the solution to the original equation.

y = uv: y = x3k ( k x1 + D )

Simplify: y = x2 + Dk x3

Replace D/k with a single constant c: y = c x3 x2

And it produces this nice family of curves:

y = c x3 x2 for various values of c

And one more example, this time even harder:

Example: Solve this:


dydx + 2xy= 2x3

First, is this linear? Yes, as it is in the form


dydx + P(x)y = Q(x)
where P(x) = 2x and Q(x) = 2x3

So let's follow the steps:

Step 1: Substitute y = uv, and dydx = u dvdx + v dudx


So this: dydx + 2xy= 2x3

Becomes this: u dvdx + v dudx + 2xuv = 2x3

Step 2: Factor the parts involving v

Factor v: u dvdx + v( dudx + 2xu ) = 2x3

Step 3: Put the v term equal to zero

v term = zero: dudx + 2xu = 0

Step 4: Solve using separation of variables to find u

Separate variables: duu = 2x dx

Put integral sign: duu = 2 x dx


Integrate: ln(u) = x2 + C

Make C = ln(k): ln(u) + ln(k) = x2

Then: uk = ex2

And so: u = ex2k

Step 5: Substitute u back into the equation at Step 2

(Remember v term equals 0 so can be ignored): ( ex2k ) dvdx = 2x3

Step 6: Solve this to find v

Separate variables: dv = 2k x3 ex2 dx

Put integral sign: dv = 2k x3 ex2 dx


Integrate: v = oh no! this is hard!

Let's see ... we can integrate by parts ... which says:

RS dx = R S dx R' ( S dx) dx
(Side Note: we use R and S here, using u and v could be confusing as they already mean
something else here.)

Choosing R and S is very important, this is the best choice we found:

R = x2 and
S = 2x ex2

So let's go:

First pull out k: v = k 2x3 ex2 dx

R = x2 and S = 2x ex2: v = k (x2)(2xex2) dx

Now integrate by parts: v = kR S dx k R' ( S dx) dx

Put in R = x2 and S = 2x ex2


And also R' = 2x and S dx = ex2

So it becomes: v = kx2 2x ex2 dx k 2x (ex2) dx

Now Integrate: v = kx2 ex2 + k ex2 + D

Simplify: v = kex2 (1x2) + D

Step 7: Substitute into y = uv to find the solution to the original equation.

y = uv: y = ex2k ( kex2 (1x2) + D )

Simplify: y =1 x2 + ( Dk)ex2

Replace D/k with a single constant c: y = 1 x2 + c ex2


Done!

Homogeneous Differential Equations


A Differential Equation is an equation with a function and one or more of its derivatives :

Example: an equation with the function y and its derivative dydx

Here we look at a special method for solving "Homogeneous Differential Equations"

Homogeneous Differential Equations


A first order Differential Equation is Homogeneous when it can be in this form:

dydx = F( yx )
We can solve it using Separation of Variables but first we create a new variable v = yx
v = yx is also y = vx

And dydx = d (vx)dx = v dxdx + x dvdx (by the Product Rule)

Which can be simplified to dydx = v + x dvdx

Using y = vx and dydx = v + x dvdx we can solve the Differential Equation.

An example will show how it is all done:

Example: Solve dydx = x2 + y2xy


Can we get it in F( xy ) style?
Start with: x2 + y2xy

Separate terms: x2xy + y2xy

Simplify: xy + yx

Reciprocal of first term: ( yx )-1 + yx

Yes! So let's go:

Start with: dydx = ( yx )-1 + yx


y = vx and dydx = v + x dvdx v + x dvdx = v-1 + v

Subtract v from both sides: x dvdx = v-1

Now use Separation of Variables :

Separate the variables: v dv = 1x dx

Put the integral sign in front: v dv = 1x dx


Integrate: v22 = ln(x) + C

Then we make C = ln(k): v22 = ln(x) + ln(k)

Combine ln: v22 = ln(kx)

Simplify: v = (2 ln(kx))

Now substitute back v = yx


Substitute v = yx: yx = (2 ln(kx))

Simplify: y = x (2 ln(kx))

And we have the solution.

Another example:

Example: Solve dydx = y(xy)x2


Can we get it in F( xy ) style?
Start with: y(xy)x2

Separate terms: xyx2 y2x2

Simplify: yx ( yx )2

Yes! So let's go:

Start with: dydx = yx ( yx )2

y = vx and dydx = v + x dvdx v + x dvdx = v v2

Subtract v from both sides: x dvdx = v2


Now use Separation of Variables :

Separate the variables: 1v2 dv = 1x dx

Put the integral sign in front: 1v2 dv = 1x dx


Integrate: 1v = ln(x) + C

Then we make C = ln(k): 1v = ln(x) + ln(k)

Combine ln: 1v = ln(kx)

Simplify: v = 1ln(kx)

Now substitute back v = yx


Substitute v = yx: yx = 1ln(kx)

Simplify: y = xln(kx)

And we have the solution.

And one last example:

Example: Solve dydx = xyx+y


Can we get it in F( xy ) style?
Start with: xyx+y

Divide through by x: x/xy/xx/x+y/x

Simplify: 1y/x1+y/x

Yes! So let's go:

Start with: dydx = 1y/x1+y/x

y = vx and dydx = v + x dvdx v + x dvdx = 1v1+v

Subtract v from both sides: x dvdx = 1v1+v v

Then: x dvdx = 1v1+v v+v21+v

Simplify: x dvdx = 12vv21+v

Now use Separation of Variables :


Separate the variables: 1+v12vv2 dv = 1x dx

Put the integral sign in front: 1+v12vv2 dv = 1x dx


Integrate: 12 ln(12vv2) = ln(x) + C

Then we make C = ln(k): 12 ln(12vv2) = ln(x) + ln(k)

Combine ln: (12vv2) = kx

Square and Reciprocal: 12vv2 = 1k2x2

Now substitute back v = yx


Substitute v = yx: 12( yx )( yx )2 = 1k2x2

Multiply through by x2: x22xyy2 = 1k2

We are nearly there ... it is nice to separate out y though!


We can try to factor x22xyy2 but we must do some rearranging first:

Change signs: y2+2xyx2 = 1k2

Replace 1k2 by c: y2+2xyx2 = c

Add 2x2 to both sides: y2+2xy+x2 = 2x2+c

Factor: (y+x)2 = 2x2+c

Square root: y+x = (2x2+c)

Subtract x from both sides: y = (2x2+c) x

And we have the solution.

You might also like