How to differentiate eight difficult functions

Hauwa Dalha
Hauwa Dalha
Hey!👋🏿 Just a computer engineering student here trying to learn and share.
34 Views
18 Min Read

Imagine a function with the equation y=f(x). A smooth curve stretches across the coordinate plane. As x changes, y will change too – but exactly how fast? This rate of change is what we are interested in. The derivative of a function tells us exactly how quickly the output (y) is changing with respect to the input (x), at any given point. The idea of “instantaneous rate of change” is what we call differentiation.

Differentiation is a mathematical topic in calculus that deals with measurement of the rate of change of a function per unit change in an independent variable. In this article you will go through eight worked examples in order to get familiar with tougher concepts. Check out “Basic rules of differentiation for learning derivatives” for an introduction into the different differentiation methods – which we will be making use of throughout the examples.

Example one

\( y = x^2 \cdot \cos\left(\frac{1}{x^3}\right) \)

This is a product of two expressions:

The first term is x²

The second term is cos(1/x³)

Whenever you’re differentiating two expressions multiplied together – like f(x)·g(x) – you must use the product rule:

Step 1: Product rule formula

\( \frac{d}{dx} \left[ f(x) \cdot g(x) \right] = f'(x) \cdot g(x) + f(x) \cdot g'(x) \)

The formula is telling you to differentiate the first part, multiply by the second as it is. Then leave the first as it is, multiply by the derivative of the second term.

So let’s label our parts:

Let f(x) = x²

Let g(x) = cos(1/x³)

Now we’ll find f'(x) and g'(x) separately, then plug them into the formula.

Step 2: Differentiate f(x) = x²

Using the power rule:

\( \frac{d}{dx} \left[ x^2 \right] = 2x \)

So:

\( f(x) = x^2 \)

\( f'(x) = 2x \)

Step 3: Differentiate g(x) = cos(1/x³)

Compared to the first term, this one is more interesting. It’s a chain rule situation, because we’re taking the cosine of a function.

Let’s write it in your head like this:

g(x) = cos(u), where u = 1/x³

Chain Rule Reminder:

If \( g(x) = \cos(u) \), then:

g'(x) = \(-sin(u) \cdot \frac{du}{dx}\)

So first, we’ll need to find:

\( u = 1/x^3 \) then find \( du/dx \)

\( u = 1/x^3 \)

You can rewrite this as:

\( u = x^{-3} \)

Now apply the power rule:

\( du/dx = d/dx \left[x^{-3}\right] = -3x^{-4} = -3 / x^4 \)

Then apply the chain rule

Back to \( g(x) = \cos(u) \), we now know:

\( u = 1/x^3 \)

\( du/dx = -3/x^4 \)

So:

\( d/dx \left[\cos\left(\frac{1}{x^3}\right)\right] = -\sin\left(\frac{1}{x^3}\right) \cdot \left(-\frac{3}{x^4}\right) \)

Let’s simplify that:

\( times – = + \), so

\( g'(x) = (3 / x^4) \cdot \sin(1/x^3) \)

Step 4: Plug everything back into the formula

\( y = x^2 \cdot \cos(1/x^3) \)

\( y’ = f'(x) \cdot g(x) + f(x) \cdot g'(x) \)

We already found:

\( f(x) = x^2 \)

\( f'(x) = 2x \)

\( g(x) = \cos(1/x^3) \)

\( g'(x) = (3 / x^4) \cdot \sin(1/x^3) \)

Now plug them in:

\( dy/dx = 2x \cdot \cos(1/x^3) + x^2 \cdot [(3 / x^4) \cdot \sin(1/x^3)] \)

Now simplify the second term a bit:

\( x^2 \cdot (3 / x^4) = 3 / x^2 \)

So your final Answer:

\( dy/dx = 2x \cdot \cos(1/x^3) + (3 / x^2) \cdot \sin(1/x^3) \)

Example two

\( y = 4^{(x^3 – \sin x)} \)

This is an exponential function, where the base is constant (4), and the exponent is a function of \( x \).

\( y = 4^{(x^3 – \sin x)} \)

So we’ll use the exponential chain rule:

Step 1: Understand the structure of the function

Outer function is \( a^u = 4^u \)

Inner function is \( u = x^3 – \sin x \)

We will apply the separate expressions into this rule:

\( \frac{d}{dx} \left[ a^u \right] = \ln(a) \cdot a^u \cdot \frac{du}{dx}\)

In our case:

a = 4

u = x³ – sinx

du/dx = ?

Step 2: Differentiate the exponent

We’re now focusing on:

\( u = x^3 – \sin x \)

Just differentiate everything term by term:

\( \frac{d}{dx} \left[ x^3 \right] = 3x^2 \)

\( \frac{d}{dx} \left[ -\sin x \right] = -\cos x \)

So:

\( \frac{du}{dx} = 3x^2 – \cos x \)

Step 3: Apply the chain rule

Now bring it all together:

\( \frac{dy}{dx} = \ln(4) \cdot 4^{(x^3 – \sin x)} \cdot (3x^2 – \cos x) \)

Final Answer:

\( \frac{dy}{dx} = \ln(4) \cdot 4^{(x^3 – \sin x)} \cdot (3x^2 – \cos x) \)

Example three

\( y = \sqrt[3]{1 + \tan(x^4)} \)

That root symbol means we’re dealing with a radical (a root expression). Specifically, a cube root – which is the same as raising to the power \(\ 1/3 \).

So let’s rewrite the function in a way that’s easier to differentiate:

\( y = [1 + \tan(x^4)]^{(1/3)} \)

This helps us see the layers of functions inside functions – we’re going to need the Chain Rule.

Step 1: Identify the structure

We’re dealing with a composite function:

Outer function: \( u^{(1/3)} \)

Inner function: \( u = 1 + \tan(x^4) \)

We want to apply:

\( \frac{d}{dx} [u^{(1/3)}] = \frac{1}{3} \cdot u^{(-2/3)} \cdot \frac{du}{dx} \)

Step 2: First differentiate the inside: \( u = 1 + \tan(x^4) \)

Let’s focus on \( u = 1 + \tan(x^4) \)

We’ll go one step at a time:

Derivative of 1 is just 0

The derivative of tan(something) is sec²(something), and then we multiply by the derivative of that “something” – that’s the chain rule again.

So:

\( \tan(x^4) \) is the outer function

\( x^4 \) is the inner function

So:

\(\frac{d}{dx} \left[ \tan(x^4) \right] = \sec^2(x^4) \cdot \frac{d}{dx}(x^4) \)

And \( \frac{d}{dx}(x^4) = 4x^3 \)

So finally:

\(\frac{d}{dx} \left[ \tan(x^4) \right] = \sec^2(x^4) \cdot 4x^3\)

Therefore:

\( \frac{du}{dx} = 4x^3 \cdot \sec^2(x^4)\)

Step 3: Put everything together

Now plug this back into the chain rule formula:

\(\frac{dy}{dx} = \frac{1}{3} \cdot \left[ 1 + \tan(x^4) \right]^{(–2/3)} \cdot \left( 4x^3 \cdot \sec^2(x^4) \right)\)

To make it more neat and simple to read, rearrange it like so:

Final Answer:

\(\frac{dy}{dx} = \frac{4x^3}{3} \cdot \sec^2(x^4) \cdot \left[ 1 + \tan(x^4) \right]^{(–2/3)}\)

Example four

\( \frac{1}{x} + \ln(y) + (xy)^3 = 4x \)

This is an implicit differentiation situation because \( y \) is mixed in with \( x \)

For those who are not very familiar with implicit differentiation; don’t worry it’s only difference is when you come to differentiate the \( y \) variables. Follow along the steps below to understand more clearly:

Step 1: Differentiate both sides with respect to \( x \)

We are going to differentiate:

\( \frac{1}{x} + \ln(y) + (xy)^3 = 4x \)

With respect to \( x \). Remember:

\( y \) is a function of \( x \)

So when we differentiate anything with \( y \), we use the chain rule and attach \(\frac{dy}{dx} \) (because \( y \) is changing with \( x \))

Let’s differentiate term by term:

1st term: \( \frac{d}{dx} \left[ \frac{1}{x} \right] \)

We use the rule: \(\frac{d}{dx} \left[ x^{-1} \right] = -x^{-2} \)

So:

\( \frac{d}{dx} \left[ \frac{1}{x} \right] = -\frac{1}{x^2} \quad \)

2nd term: \( \frac{d}{dx} \left[ \ln(y) \right] \)

This is where people often mess up.

This isn’t \( \ln(x) \), it’s \( \ln(y) \). And \(y \) is a function of \( x \). So we need to use the chain rule.

We remember:

\( \frac{d}{dx} \left[ \ln(u) \right] = \frac{1}{u} \cdot \frac{du}{dx} \)

Here, \( u = y \), so:

\( \frac{d}{dx} \left[ \ln(y) \right] = \frac{1}{y} \cdot \frac{dy}{dx} \)

3rd term: \( \frac{d}{dx} \left[ (xy)^3 \right] \)

Just like before, we let \( u = xy \)

Then use the chain rule:

\(\frac{d}{dx} \left[ (xy)^3 \right] = 3(xy)^2 \cdot \frac{d}{dx}[xy]\)

Now:

\(\frac{d}{dx} [xy] \text{ – use the product rule:}\)

\(\frac{d}{dx} [xy] = x \cdot \frac{dy}{dx} + y\)

So the full result is:

\(\frac{d}{dx} \left[ (xy)^3 \right] = 3(xy)^2 \cdot \left( x \cdot \frac{dy}{dx} + y \right)\)

Right-hand side: \( \frac{d}{dx} [4x] = 4 \)

Step 2: Combine all pieces

So we now have:

\(-\frac{1}{x^2} + \frac{1}{y} \cdot \frac{dy}{dx} + 3(xy)^2 \left( x \cdot \frac{dy}{dx} + y \right) = 4 \)

That’s your full derivative expression so far but our goal is to solve for \(\frac{dy}{dx}\).

Step 3: Make \(\ \frac{dy}{dx}\) the subject of the formula

The remaining steps are to just use our basic algebraic skills to isolate all \(\frac{dy}{dx}\) terms on one side.

Your equation is:

\( -\frac{1}{x^2} + \frac{1}{y} \cdot \frac{dy}{dx} + 3(xy)^2 \left( x \cdot \frac{dy}{dx} + y \right) = 4 \)

Let’s expand the big term:

Distribute the \(3(xy)^2\):

\( 3(xy)^2 \cdot x \cdot \frac{dy}{dx} = 3x(xy)^2 \cdot \frac{dy}{dx} \)

\( 3(xy)^2 \cdot y = 3y(xy)^2 \)

So now the equation becomes:

\( -\frac{1}{x^2} + \frac{1}{y} \cdot \frac{dy}{dx} + 3x(xy)^2 \cdot \frac{dy}{dx} + 3y(xy)^2 = 4 \)

Now group all \( \frac{dy}{dx}\) terms on the left:

\(\left[ \frac{1}{y} + 3x(xy)^2 \right] \cdot \frac{dy}{dx} = 4 + \frac{1}{x^2} – 3y(xy)^2 \)

Final Answer:

\(\frac{dy}{dx} = \frac{4 + \frac{1}{x^2} – 3y(xy)^2}{\frac{1}{y} + 3x(xy)^2} \)

Example five

\( y = \frac{e^{3x}}{x^2 + 1} \)

You’ve got a rational function (a function divided by another function), so we will be using quotient rule which is made for these exact types of functions.

Quotient Rule:

If \( y = \frac{f(x)}{g(x)} \),

Then \( \frac{dy}{dx} = \frac{f'(x) \cdot g(x) – f(x) \cdot g'(x)}{[g(x)]^2} \)

The formula is telling you to differentiate the top and multiply by the bottom as it i, then subtract the top as it is times the derivative of the bottom – then divide the whole thing by the bottom squared. It is basically the product rule except for the additional division by \( g(x)^2 \)

Apply the rule:

Let:

\( f(x) = e^{3x} \) – we’ll do this one first

\( g(x) = x^2 + 1 \) – that’s the bottom function

Step 1: Differentiate the numerator (f)

This is an exponential function with a more complex exponent.

\( f(x) = e^{3x} \)

\( f'(x) = 3e^{3x} \) – because of the chain rule:

The derivative of \( e^u \) is \( e^u \cdot \frac{du}{dx} \)

Step 2: Differentiate the denominator (g)

\( g(x) = x^2 + 1 \)

That’s a plain polynomial:

\( g'(x) = 2x \)

Put it into the quotient rule:

\( \frac{dy}{dx} = \frac{3e^{3x} \cdot (x^2 + 1) – e^{3x} \cdot 2x}{(x^2 + 1)^2} \)

Final Answer:

\( \frac{dy}{dx} = \frac{3e^{3x}(x^2 + 1) – 2x \cdot e^{3x}}{(x^2 + 1)^2} \)

Example six

\( y = \arctan(x^3) \)

This is an inverse trig function, specifically arctangent, applied to a more complex expression: \( x^3 \). That’s a chain rule situation – we’re taking a function (arctangent) of another function \( x^3 \).

Base Rule You Must Know:

\( \frac{d}{dx} [\arctan(u)] = \frac{u’}{1 + u^2} \)

So we’ll:

1. Identify \( u \)

2. Find \( u’ \)

3. Plug into the formula

Let \( u = x^3 \)

Then \( u’ = 3x^2 \)

\( u^2 = (x^3)^2 = x^6 \)

Now plug into the formula:

\( \frac{dy}{dx} = \frac{3x^2}{1 + x^6} \)

Final Answer:

\( \frac{dy}{dx} = \frac{3x^2}{1 + x^6} \)

The key thing to remember for this question: Don’t treat arctan like a trig function. It’s an inverse, and has a specific formula when being differentiated.

Example seven

\( f(x) = [\sin(4x)]^3 \)

You’re looking at a power of a trig function. Inside that, you’ve got another function: \( 4x \). So this is a chain rule inside a chain rule. Let’s break it down layer by layer.

Rewrite to see layers:

Let’s say:

\( f(x) = [\sin(4x)]^3 \)

This is like saying:

Outer function: \( u^3 \)

Middle function: \( u = \sin(4x) \)

Inner function: \( 4x \)

Step-by-step:

1. Derivative of \( u^3 = 3u^2 \cdot \frac{du}{dx} \)

So we’ll get:

\( f'(x) = 3[\sin(4x)]^2 \cdot \frac{d}{dx} [\sin(4x)] \)

Now differentiate \( \sin(4x) \):

\( \frac{d}{dx} [\sin(4x)] = \cos(4x) \cdot 4 = 4\cos(4x) \)

Now put everything together:

\( f'(x) = 3[\sin(4x)]^2 \cdot 4\cos(4x) \)

Multiply constants:

\( f'(x) = 12\sin^2(4x) \cdot \cos(4x) \)

Final Answer:

\( f'(x) = 12\sin^2(4x) \cdot \cos(4x) \)

In examples with triple-layer chain rule, spotting and breaking down the layers should always be your first step.

Example eight

This final example may seem hard to approach but it is fairly straightforward

\( y = x^x \)

The function is clearly not a normal power function (like \( x^n \)) or a normal exponential (like \( a^x \)). It’s both:

Base = \( x \)

Exponent = \( x \)

So we can’t use the regular power rule. We have to use another differentiation method known as logarithmic differentiation.

Logarithmic differentiation step by step

Start with \( y = x^x \)

Take the natural log of both sides:

\( ln(y) = \ln(x^x) \)

Now apply the log rule:

\( ln(a^b) = b \cdot \ln(a) \)

So \( ln(y) = x \cdot \ln(x) \)

Now differentiate both sides with respect to \( x \).

Left side:

\(\frac{d}{dx} \left[ \ln(y) \right] = \frac{1}{y} \cdot \frac{dy}{dx} \)

(Chain rule – y is a function of x)

Right side:

\( \frac{d}{dx} \left[ x \cdot \ln(x) \right] \) – this is a product of two functions

Use the product rule:

\( \frac{d}{dx} \left[ x \right] = 1 \)

\( \frac{d}{dx} \left[ \ln(x) \right] = \frac{1}{x} \)

So:

\( \frac{d}{dx} \left[ x \cdot \ln(x) \right] = \ln(x) + x \cdot \left( \frac{1}{x} \right) = \ln(x) + 1 \)

Now set both sides equal:

\( \frac{1}{y} \cdot \frac{dy}{dx} = \ln(x) + 1 \)

Now multiply both sides by \( y \):

\( \frac{dy}{dx} = y \cdot (\ln(x) + 1) \)

Remember, \( y = x^x \), so we must substitute it back and your final answer will be:

\(\ \frac{dy}{dx} = x^x \cdot (\ln(x) + 1) \)

Hopefully with these eight high level but straightforward examples you will be able to improve your differentiation skills. Of course though the real key to getting good at solving any kind of derivatives is not just by solving a few examples but constant trial and error through practice. 

Leave a Comment
×