# 9231. FP2. Differentiation

Implicit Functions

We can differentiate functions that are not explicitly written as y=f(x).

• e.g. y2 = x. Differentiating both sides wrt x gives:
• 2y.y'(x) = 1, so
• y'(x) = 1/2y.

If we use Leibniz’ notation, we think of $\frac{d}{dx}$ instead of $\frac{dy}{dx}$ as an operator (e.g. above, $\frac{d}{dx}(y^2) = \frac{d}{dx} (x)$

We can also find the second derivative this way,

• e.g. x3+y2=2y. Differentiating once wrt x gives:
• $3x^2 + 2y\frac{dy}{dx} = 2\frac{dy}{dx}$. (*) Differentiating again gives:
• $6x + 2\frac{dy}{dx} \frac{dy}{dx} + 2y\frac{d^2y}{dx^2} = 2\frac{d^2y}{dx^2}$, which rearranges to give:
• $\frac{d^2y}{dx^2}(2-2y) = 6x + 2(\frac{dy}{dx})^2$, so
• $\frac{d^2y}{dx^2} = \frac{6x + 2(\frac{dy}{dx})^2}{2-2y}$ (**).
• Rearranging line (*) gives: $\frac{dy}{dx}(2-2y) = 3x^2$, which rearranges to give
• $\frac{dy}{dx} = \frac{3x^2}{2-2y}$. We can then substitute this into (**) to give:
• $\frac{d^2y}{dx^2} = \frac{6x + 2(\frac{3x^2}{2-2y})^2}{2-2y}$ (**), which simplifies to give:
• $\frac{d^2y}{dx^2} = \frac{6x(2-2y)^2 + 2(9x^4)}{(2-2y)^3}$ (**), so:
• $\frac{d^2y}{dx^2} = \frac{6x(2-2y)^2 + 18x^4}{(2-2y)^3}$.

Worked Example

Given that ex + e2y = ln(y), find the first and second derivative w.r.t. x

Let’s consider the slightly more complicated x3y2 + y = sinx

Differentiating this gives us $3x^2y^2 + x^32y\frac{dy}{dx} + \frac{dy}{dx}= cosx$ (*)

Notice that in the middle we have a triple product. To differentiate this we use the formula: (uvw)’ = uvw’ + uv’w + u’vw.

So, differentiating again we have $6xy^2 + 3x^22y\frac{dy}{dx} + 3x^22y\frac{dy}{dx} + x^32\frac{dy}{dx}\frac{dy}{dx} + x^32y\frac{d^2y}{dx^2} + \frac{dy}{dx} = -sinx$ (**)

As before, we can then rearrange the algebra in (*) and (**) to find expressions for $\frac{dy}{dx}$ and $\frac{d^2y}{dx^2}$

Worked Example

xex+y = (x+1)2. Find the first and second derivatives with respect to x

Note in the above example that if the algebra is very complicated, it isn’t always necessary to simplify, if we only need numerical values for the first and second derivative. It is often easier to leave the expression unsimplified and substitute in the numerical values.

Worked Example

Given that y3+yx2=ex passes through he point A(0,1), find the values of the first and second derivatives at the point A.

Exercise

Parametric Equations

If we know y in terms of t and x in terms of t, we can calculate the gradient of the curve by first calculating $\frac{dy}{dt}$ and $\frac{dx}{dt}$ and then using the chain rule to combine them to calculate $\frac{dy}{dx}$.

Note that this will give us the first derivative as a function of t, so to find the second derivative we must differentiate $\frac{dy}{dx}$ with respect to t, using $\frac{d^2y}{dx^2} = \frac{d}{dt}(\frac{dy}{dx}) \times \frac{dt}{dx}$

So if x = t2 and y = t+1, we would calculate $\frac{dx}{dt} = 2t$ and $\frac{dy}{dt} = 1$ and combine them to give $\frac{dy}{dx} = \frac{1}{2t}$. For the second derivative we calculate $\frac{d}{dt} (\frac{1}{2t}) = -\frac{1}{2t^2}$ and so have $\frac {d^2y}{dx^2} = -\frac{1}{2t^2} \frac{1}{2t} = -\frac{1}{4t^3}$

Worked Examples

• If $x = \frac{1}{t+1}$ and y = t2, find the first and second derivatives of y with respect to x.
• If x=tet and y=t3-t, determine the functions $\frac{dy}{dx}$ and $\frac{d^2y}{dx^2}$

Once we have the first and second derivatives we can, of course, find the coordinates of stationary points and determine their nature.

Worked Example

• A parametric curve is represented by the equations x = t4+5 and y = t3-3t2. Find the coordinates of any stationary points and determine their nature.

Exercise

Hyperbolic and Inverse Trigonometric Functions

We now look at differentiating the hyperbolic functions which we met in an earlier section:

• $sinh x = \frac{e^x - e^{-x}}{2}$
• $cosh x = \frac{e^x + e^{-x}}{2}$
• $tanh x = \frac{e^x - e^{-x}}{e^x + e^{-x}}$

(sinhx)’ = $(\frac{e^x-e^{-x}}{2})'$ = $(\frac{e^x+e^{-x}}{2})$ = coshx

(coshx)’ = $(\frac{e^x+e^{-x}}{2})'$ = $(\frac{e^x-e^{-x}}{2})$ = sinhx

So we have the straightforward relationship that the derivative of sinhx is coshx and the derivative of coshx is sinhx.

Worked Example

Find the derivatives of:

• y = sinh2x
• y = coshx2
• y = sinh2x
• y = cosh3xsinh4x

Now let’s consider the remaining hyperbolic functions, tanhx, sechx, cosechx and cothx:

(tanhx)’ = $(\frac{sinhx}{coshx})'$ = $(\frac{(coshx)^2-(sinhx)^2}{cosh^2x}$ = $\frac{1}{cosh^2x}$ = sech2x

(sechx)’ = $(\frac{1}{coshx})'$ = $(\frac{- sinh x}{cosh^2x})'$ = -sechxtanhx

Can you follow the same logic for cosech x and coth x?

The derivatives of these functions are summarised below:

Worked Example

Find $\frac{dy}{dx}$ for each of these functions:

• y = 2xsech(3x-1)
• y = ln(tanhx)
• y = x2ecothx
• sinh(x+y) = y2x3

Inverse trigonmetric and hyperbolic functions

We tackle these by rearranging them as the original functions and implicitly differentiating.

e.g. y = sin-1x, so

• sin y = x, so differentiating gives:
• $cos y \frac{dy}{dx} = 1$, so
• $\frac{dy}{dx} = \frac{1}{cos y}$
• As siny = x, so cos y = $\pm \sqrt{1-x^2}$
• So $\frac{dy}{dx} = \frac{1}{\pm \sqrt{1-x^2}}$

We can see from the graph of y = sin-1x below (obtained by reflecting the graph of y = sinx in the line y=x) that the graph is always increasing, so dy/dx is always positive, so our result is the + variant of the two above, i.e. y = sin-1x, so $\frac{dy}{dx} = \frac{1}{\sqrt{1-x^2}}$

See if you can follow the same logic to find the derivative of y = cos-1x and y = tan-1x. (for tan you will need to remember the different trigonometric forms of Pythagoras’ Theorem.

The derivatives of the inverse trigonometric functions are summarised below:

Worked Example

Find the derivatives of the following functions:

• y = xcos-1x
• y = xtan-13x
• xy = sin-12x

We follow the same techniques to differentiate inverse hyperbolic functions. Below are the graphs of sinh-1x and cosh-1x – with the help of these, let’s differentiate sinh-1x, cosh-1x and tanh-1x.

The results are summarised below:

Exercise

Maclaurin Series

We have already seen binomial expansions that allow us to approximate f(x) = (a+bx)n. In order to approximate other functions such as f(x) = ex, we are going to use the Taylor Series.

The Taylor Series is a function f(x) that can be differentiated infinitely many times. It is evaluated at a specific point, x = a to give:

$f(x) \approx f(a) + f'(a)(x-a) + \frac{f''(a)(x-a)^2}{2!} + \frac{f'''(a)(x-a)^3}{3!} + ...$

We will be using a special case of the Taylor Series, called the Maclaurin Series, for which a = 0:

$f(x) \approx f(0) + f'(0)x + \frac{f''(0)x^2}{2!} + \frac{f'''(0)x^3}{3!} + ...$

We can write this in summation form as $\sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}x^n = 1$

In order to see how this works, let’s consider the function $f(x) = \frac{1}{1-x}$

We already know from the binomial theorem that $f(x) = \frac{1}{1-x} = (1-x)^{-1} = 1 + x + x^2 + x^3 + ...$. Now let’s deduce this using the Taylor Series.

f(x) = (1-x)-1, so f(0)=1

f'(x) = (-1)(1-x)-2(-1), so f'(0) = 1

f”(x) = (-2)(1-x)-3(-1), so f”(0) = 2

f”'(x) = 2(-3)(1-x)-4(-1), so f”'(0) = 6

f(4)(x) = 6(-4)(1-x)-5(-1), so f(4)(0) = 24

Combining these into the Maclaurin Series, gives f(x) ≃ 1 + x + 2x2/2! + 6x3/3! + 24x4/4!, which is the same as our result above.

Now let’s try following the same steps for f(x) = ex.

Worked Example

Find the Maclaurin Series approximation for f(x) = sin(x), giving the first four non-zero terms.

N.B. For f(x) = cos x, we have two alternatives. Either do the process we did for f(x) = sinx, or simply differentiate each of the terms in the expansion f(x) = sinx.

Worked Example

If f(x) = sin-1x, find the first three non-zero terms of the Maclaurin Series for this function. Also, find an estimate for sin-1(0.1) to 9 decimal places.

We can also determine the series of a function by comparing it to a know series. So if we want to expand y = sin2x, we can substitute 2x for x in the expansion of sinx to give sin 2x ≃ 2x – (2x)3/3! + (2x)5/5! – (2x)7/7! + … , which simplifies to give sin 2x ≃ 2x – 4x3/3 + 4x5/15 – 8x7/315

Worked Examples

• Using calculus, find the Maclaurin Series for tan x, giving the first three non-zero terms. Use your result to determine tan (x/2) and ln(sec(x))
• Find the Maclaurin Series for y = ln(1+x), giving four nonzero terms. Use your result to estimate ln(1.1) to 6 decimal places.

Exercise & General Exercises