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.

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

## 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.

## 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:

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."

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?

## 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").

## 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

= 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

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

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

## 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

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

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

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

= 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

## 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.

## 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)

## (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

... ...

## 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"

## 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"

## 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

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

... ...

## 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

## 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.

## 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

## 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"

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.

## 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.

## Answer: We don't know!

Why don't we know?

## 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

## 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"

In other words:

## 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.

## ... 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:

## 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

## 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 ...

## 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:

## 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) .

## 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)

## (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

... ...

## 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"

## 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:

## 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 ).

## 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
2. Factors

Example:

## 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:

## So, let's try some rearranging:

Multiply top and bottom by the conjugate of the top:

Done!

## 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)

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)

## (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

... ...

## 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"

## 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"

## 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 .

## Example 1: |4.014| = 0.01

Example 2: |3.84| = 0.2

## 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".

## 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 ...

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.

## Play around till we find a formula that might work

Test to see if that formula works.

## 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
|(2x+4)10|<

Simplify:
|2x6|<

Move 2 outside:
2|x3|<

Move 2 across:
|x3|< /2

## Let's see ...

0<|x3|<

Replace : 0<|x3|< /2

Move 2 across:
0<2|x3|<

Move 2 inside:
0<|2x6|<

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

DONE!

## "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).

## 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

Domain

## A function has a Domain.

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

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

## 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):

## "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)

## The function is undefined when x=1:

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

## 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.

## 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

## And so the function is not continuous.

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

## 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!

## But how do we find the slope at a point?

There is nothing to measure!

## Let us Find a Derivative!

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

## 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:

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

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

## 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.

## 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 ?

x3 = 3x2

## Derivatives of Other Functions

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

Derivative Rules

Done.

## 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.

## 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.

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".

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))

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

## Difference Rule f-g f g

Product Rule fg f g + f g

## 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)

## "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) ?

## It can be written as:

sin(x) = cos(x)

Or:

sin(x) = cos(x)

Power Rule

Example: What is x3 ?

xn = nxn1

x3 = 3x31 = 3x2

## 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

x3 = 3x31 = 3x2

So:

Sum Rule

## The Sum Rule says:

the derivative of f + g = f + g

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

x2 = 2x

x3 = 3x2

And so:

Difference Rule

## The Difference Rule says

the derivative of f g = f g

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

v3 = 3v2

v4 = 4v3

And so:

z2 = 2z

z3 = 3z2

z4 = 4z3

And so:

Product Rule

## The Product Rule says:

the derivative of fg = f g + f g

In our case:

f = cos
g = sin

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

So:

## the derivative of 1/x = 1/x2

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

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

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

So:

= 2x cos(x2)

dydx = dydududx

## ddx sin(x2) = ddusin(u)ddxx2

Differentiate each:

## Another couple of examples of the Chain Rule:

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

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

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

So:

= sin(x)/cos2(x)

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

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!)

## 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)

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

## 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

## Second Derivative is Acceleration: d2sdt2 2 m/s2

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

## Here is a function of one variable (x):

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

f(x) = 2x

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.

## 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"

## 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"

## 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.

## 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)

## 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

fx = 2x

## 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 .

## 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)

lim lim lim
= =
h0 h0 h0
h h h

## 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.

## 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.

## 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).

## 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

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

## Now find when the slope is zero:

14 10t = 0

10t = 14

t = 14 / 10 = 1.4

## And the height at that time is:

h = 3 + 141.4 51.42

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

## 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):

## 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)

y = 5x3 + 2x2 3x

y = 15x2 + 4x 3

x = 3/5
x = +1/3

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

At x = 3/5:

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

At x = +1/3:

## (Now you can look at the graph.)

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

## 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

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

## 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).

## 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 downward is when the slope decreases:

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

## 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):

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

## 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:

## 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)

## 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!

## 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).

## 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:

## 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

## How to do Implicit Differentiation

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

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

Let's solve each term:

2x + 2ydydx = 0

ydydx = x

dydx = xy

## 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

## The Chain Rule can also be written using notation:

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

f(y) = f(y)y

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

## 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

Derivatives:

## 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.

## 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:

And we get:

9y220x3
dydx =
3(5y26xy)

Product Rule

= 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.

## 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.

1 = cos(y) dydx

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

sin2 y + cos2 y = 1

cos y = (1 sin2 y )

cos y = (1 x2)

## Example: the derivative of square root x

So: y2 = x
Derivative: 2ydydx= 1

## Because y = x: dydx = 12x

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

As a power: y = 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.

## It says that the function: ex

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

## 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?

## (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! + 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)

## 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)

f(a) = c1

So c1 = f(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:

## 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

## 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:

Simplify:

## 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:

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):

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:

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

... so an integral of 2x is x2

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.

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.

## 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.

## 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.

## 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.

## 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

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.

## 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

## 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

## 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

## 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:

## Example: What is x cos(x) dx ?

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

u=x
v = cos(x)

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

Differentiate u: u' = x' = 1

## 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

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

First choose u and v:

u = ln(x)
v = 1/x2

## 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 ?

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:

## 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:

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:

Simplify:

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

It is based on the Product Rule for Derivatives :

## (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:

## 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

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

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 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.

(Yay!)

Example:

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

(Note: x must be in radians )

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

= sin(1) sin(0.5)

= 0.841... 0.479...

= 0.362...

Example:

## 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:

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

The definite integral will work out the net area.

## 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).

## One for the area above the x-axis

One for the area below the x-axis

/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:

## 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:

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:

## 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.

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:

## 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

## Find the derivative of f(x)

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

S=

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

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

S=

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=

0

1 + (f(x)) dx

S=

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

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.

## The derivative is y = (3/2)x(1/2)

S=

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

## 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.

## 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)

## 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) )

## 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):

## Plugging in values of ln(1) etc gives:

0.53 ( 15.2679... )
2.544648...

## Plus and Minus

Note that when the curve is below the axis the area is negative.

## Error and Accuracy

Let's compare them all:

## 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

## 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.

## 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

## 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.

## 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.

## 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:

## 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

## 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

Volume =
b

(x)2 dx

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:

= b3/3

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?

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

Volume =

0
(x+1)2 dx

Volume =

(x2+2x+1) dx

= (b3/3+b2+b)

Volume =
1.6

0.6

(x2)2 dx

Volume =

1.6

0.6

x4 dx

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

x = (y)

Volume =

1.4

0.4

(y)2 dy

Volume =

1.4

0.4

y dy

2.83...

Washer Method

## What if we want the volume between two functions?

Example: Volume between the functions y=x and y=x3 from x=0 to 1

## 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.

Volume =

(x)2 (x3)2 dx

Volume =
1

(x)2 (x3)2 dx

Simplify:

Volume =

x2 x6 dx

## 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 population N at any time t

the growth rate r

## 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.

## 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.

## 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

## 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

## 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

m d2xdt2 = kx

## 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

## "Ordinary Differential Equations" (ODEs) have a single independent variable (like y)

"Partial Differential Equations" (PDEs) have two or more independent variables.

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

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 :

## 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.

## 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 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

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.

## 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

## 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:

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

## 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)

## 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

## 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
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

## 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:

## 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

## 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:

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!

dydx yx = 1

## dydx + P(x)y = Q(x)

where P(x) = 1x and Q(x) = 1

## Step 1: Substitute y = uv, and dydx = u dvdx + v dudx

So this: dydx yx = 1

So: dudx = ux

## Put integral sign: duu = dxx

Integrate: ln(u) = ln(x) + C

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

## Put integral sign: k dv = dxx

Integrate: kv = ln(x) + C

## 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)

## 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

## 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 .

dydx 3yx = x

## dydx + P(x)y = Q(x)

where P(x) = 3x and Q(x) = x

## Step 1: Substitute y = uv, and dydx = u dvdx + v dudx

So this: dydx 3yx = x

## Separate variables: duu = 3 dxx

Put integral sign: duu = 3 dxx
Integrate: ln(u) = 3 ln(x) + C

Then: uk = x3

## 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

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

## Step 1: Substitute y = uv, and dydx = u dvdx + v dudx

So this: dydx + 2xy= 2x3

## Put integral sign: duu = 2 x dx

Integrate: ln(u) = x2 + C

Then: uk = ex2

## 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.)

R = x2 and
S = 2x ex2

So let's go:

## Put in R = x2 and S = 2x ex2

And also R' = 2x and S dx = ex2

## y = uv: y = ex2k ( kex2 (1x2) + D )

Simplify: y =1 x2 + ( Dk)ex2

Done!

## Homogeneous Differential Equations

A Differential Equation is an equation with a function and one or more of its derivatives :

## 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

## Example: Solve dydx = x2 + y2xy

Can we get it in F( xy ) style?

## Separate terms: x2xy + y2xy

Simplify: xy + yx

## Start with: dydx = ( yx )-1 + yx

y = vx and dydx = v + x dvdx v + x dvdx = v-1 + v

## Put the integral sign in front: v dv = 1x dx

Integrate: v22 = ln(x) + C

## 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))

Another example:

## Example: Solve dydx = y(xy)x2

Can we get it in F( xy ) style?

## Separate terms: xyx2 y2x2

Simplify: yx ( yx )2

## Subtract v from both sides: x dvdx = v2

Now use Separation of Variables :

## Put the integral sign in front: 1v2 dv = 1x dx

Integrate: 1v = ln(x) + C

## Combine ln: 1v = ln(kx)

Simplify: v = 1ln(kx)

## Now substitute back v = yx

Substitute v = yx: yx = 1ln(kx)

Simplify: y = xln(kx)

## Example: Solve dydx = xyx+y

Can we get it in F( xy ) style?

## Divide through by x: x/xy/xx/x+y/x

Simplify: 1y/x1+y/x

## 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

## Now substitute back v = yx

Substitute v = yx: 12( yx )( yx )2 = 1k2x2

## 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: