How to Differentiate a Function Step by Step: A Beginner’s Guide


How to Differentiate a Function Step by Step: A Beginner’s Guide

The derivative of a function tells us the rate at which a function changes as we vary the input. It’s a mathematical tool that helps us measure speed, growth, and countless other phenomena in the world around us. Calculating the derivative of a function is called differentiation. This guide teaches you how to differentiate a function step by step. Whether you’re just starting out or brushing up on old skills, it will provide you with a path toward understanding.

The following infographic illustrates the concepts covered in this article.

Differentiation Infographic Resized. Related Article: How to Differentiate a Function Step by Step: A Beginner's Guide.

Understanding the Basics of Differentiation

Let’s start with the basics. Differentiation provides a way to measure how one quantity shifts when another does. This concept is handy in everyday life, whether you’re trying to figure out how fast a car is moving at a given moment or tracking how quickly a projectile is falling.

Limit Definition of the Derivative

The limit definition of the derivative gives us a way to measure how a function changes at a specific point. It is written as,

$$f'(x) = \lim_{h \to 0} \frac{f(x+h) – f(x)}{h}.$$

To understand the definition of the derivative, think about how we calculate the slope of a straight line. We take the change in y and divide it by the change in x. But what if the function isn’t a straight line?

That’s where this definition comes in. Instead of looking at the slope between two fixed points, we pick a point x and choose another point slightly to the right or left, at x + h. The difference in function values, f(x+h) − f(x), tells us how much the function output changes, and h tells us how far apart the points are.

The key step is taking the limit as h approaches zero. This means shrinking the gap between the two points until they are practically the same. The result is the instantaneous rate of change, or how fast the function changes at exactly the point x.

For a better understanding of limits please check out my article How to Calculate Limits in Calculus: Everything You Need to Know.

Applications

This concept has many real-world uses. In physics, it describes velocity. In business, it helps determine how profits change when production increases by a tiny amount. Whether studying motion, growth, or optimization, derivatives give a precise way to understand change.

Notation

In mathematics, there are various notations to represent the derivative. Here are two of the most common ones:

Leibniz notation: Written as \(\frac{dy}{dx}\)​, this format shows how a slight change in x leads to a change in y.

Prime notation: Written as f'(x), this notation indicates the derivative of the function f at a specific point x.

Familiarizing yourself with these concepts is a prerequisite to understanding differentiation. As we move forward, we’ll look at the fundamental rules that will help you understand the process of finding derivatives.

The Fundamental Rules of Differentiation

Now that we’ve covered the basics, let’s look at the basic rules for differentiation. These rules will help you calculate simple derivatives and are a prerequisite for learning more advanced techniques.

The Power Rule

One of the most straightforward and valuable rules is the Power Rule. It says that if you have a function like \(f(x) = x^{n}\), (where n is any number), you can find the derivative by using the formula

$$f'(x) = n x^{n-1}.$$

Essentially, you take the exponent, bring it down in front as a coefficient, and then reduce the exponent by one.

The Constant Rule

Next is the Constant Rule, which is also straightforward since the derivative of any constant is zero. You can express this as

$$\frac{d}{dx} C = 0.$$

This makes sense, as constants don’t change.

The Constant Multiple Rule

You can use the Constant Multiple Rule if you have a function multiplied by a constant. It states

$$\frac{d}{dx} [c f(x)] = c f'(x).$$

Here, c represents the constant.

The Sum and Difference Rules

When you’re adding or subtracting functions, the Sum and Difference Rules come into play:

$$\frac{d}{dx} [f(x) \pm g(x)] = f'(x) \pm g'(x).$$

This means you can differentiate each function separately and then combine the results.

Example

With the rules introduced in this section and algebraic manipulations, we can already solve some interesting derivative problems.

Example 1: Compute the derivative of the following functions:
(a) \(f(x) = x^2 + 7x + 12\)
(b) \(g(x) = \frac{(x+1)^2}{x}\)
(c) \(h(x) = \frac{x+2}{\sqrt{x}}\)

Solution: (a) \(f(x) = x^2 + 7x + 12\)

Using the sum rule gives

$$f'(x) = \frac{d}{dx} (x^2) + \frac{d}{dx} (7x) + \frac{d}{dx} (12).$$

Applying the constant multiple rule, we obtain

$$f'(x) = \frac{d}{dx} (x^2) + 7\frac{d}{dx} (x) + \frac{d}{dx} (12).$$

Differentiating, we arrive at a final answer of

$$f'(x) = 2x + 7.$$

(b) \(g(x) = \frac{(x+1)^2}{x}\)

First, rewrite the function in terms of positive and negative exponents to obtain

$$g(x) = (x+1)^2 x^{-1}.$$

Expanding \((x+1)^2\) gives

$$g(x) = (x^2 + 2x + 1)x^{-1}.$$

Now distribute \(x^{-1}\) to get

$$g(x) = x + 2 + x^{-1}.$$

Next, apply the sum rule to obtain

$$g'(x) = \frac{d}{dx} x + \frac{d}{dx} 2 + \frac{d}{dx} x^{-1}.$$

Differentiating, we find that

$$g'(x) = 1 – x^{-2}.$$

Rewriting the second term gives

$$g'(x) = 1 – \frac{1}{x^2}.$$

Multiplying the first term by \( \frac{x^2}{x^2} \) this is equivalent to

$$g'(x) = \frac{x^2}{x^2} – \frac{1}{x^2}.$$

Subtracting, we arrive at a final answer of

$$g'(x) = \frac{x^2 – 1}{x^2}.$$

(c) \(h(x) = \frac{x+2}{\sqrt{x}}\)

First, rewrite the root as a fractional exponent to find that

$$h(x) = \frac{x+2}{x^{\frac{1}{2}}}.$$

In terms of negative exponents, this is equivalent to

$$h(x) = (x+2) x^{-1/2}.$$

Now distribute \(x^{-1/2}\) to obtain

$$h(x) = x^{\frac{1}{2}} + 2x^{-\frac{1}{2}}.$$

Differentiating then gives

$$h'(x) = \frac{1}{2} x^{-\frac{1}{2}} – x^{-\frac{3}{2}}.$$

In terms of positive exponents, this is equivalent to

$$h'(x) = \frac{1}{2x^{\frac{1}{2}}} – \frac{1}{x^{\frac{3}{2}}}.$$

Multiplying the first term by \( \frac{x}{x} \), and the second term by \( \frac{2}{2} \) we obtain

$$h'(x) = \frac{x}{2x^{\frac{3}{2}}} – \frac{2}{2x^{\frac{3}{2}}}.$$

Subtracting then gives

$$h'(x) = \frac{x – 2}{2x^{\frac{3}{2}}}.$$

Rewriting the fractional exponent as a root, we arrive at a final answer of

$$h'(x) = \frac{x – 2}{2\sqrt{x^3}}.$$

How to Differentiate Common Functions

Now that we’ve covered the basics of differentiation, let’s explore how to differentiate some standard functions you’ll encounter.

Polynomials

This section is only here for completeness. All polynomials can be differentiated using the techniques covered in the previous section. See part a of Example 1 to learn how to compute the derivative of a polynomial.

Trigonometric Functions

Next, let’s look at trigonometric functions. Each of these has specific derivatives you should know.

$$\frac{d}{dx} \sin(x) = \cos(x)$$
$$\frac{d}{dx} \cos(x) = -\sin(x)$$
$$\frac{d}{dx} \tan(x) = \sec^2(x)$$
$$\frac{d}{dx} \cot(x) = -\csc^2(x)$$
$$\frac{d}{dx} \sec(x) = \sec(x)\tan{x}$$
$$\frac{d}{dx} \csc(x) = -\csc(x)\cot{x}$$

Be careful with the signs.

Exponential Functions

The derivative of \(e^x\) is unique because it remains unchanged upon differentiation:

$$\frac{d}{dx} e^x = e^x.$$

Logarithmic Functions

The derivative of the natural logarithm is

$$\frac{d}{dx} \ln(x) = \frac{1}{x}.$$

Hyperbolic Functions

Hyperbolic functions are analogs of trigonometric functions. Their derivatives are:

$$\frac{d}{dx} \sinh(x) = \cosh(x)$$
$$\frac{d}{dx} \cosh(x) = \sinh(x)$$
$$\frac{d}{dx} \tanh(x) = \text{sech}^2(x)$$
$$\frac{d}{dx} \coth(x) = -\text{csch}^2(x)$$
$$\frac{d}{dx} \text{sech}(x)= -\text{sech}(x)\tanh(x)$$
$$\frac{d}{dx} \text{csch}(x) = -\text{csch}(x)\coth(x)$$

Inverse Trigonometric Functions

The derivatives of inverse trigonometric functions are important in integration problems, especially inverse tangent and inverse sine:

$$\frac{d}{dx} \arcsin(x) = \frac{1}{\sqrt{1 – x^2}}$$
$$\frac{d}{dx} \arccos(x) = -\frac{1}{\sqrt{1 – x^2}}$$
$$\frac{d}{dx} \arctan(x) = \frac{1}{1 + x^2}$$
$$\frac{d}{dx} arccot(x) = -\frac{1}{1 + x^2}$$
$$\frac{d}{dx} \text{arcsec}(x) = \frac{1}{|x|\sqrt{x^2 – 1}}$$
$$\frac{d}{dx} \text{arccsc}(x) = -\frac{1}{|x|\sqrt{x^2 – 1}}$$

Inverse Hyperbolic Functions

Inverse hyperbolic functions also have useful derivatives, though they are uncommon:

$$\frac{d}{dx} \text{arsinh}(x) = \frac{1}{\sqrt{x^2 + 1}}$$
$$\frac{d}{dx} \text{arcosh}(x) = \frac{1}{\sqrt{x^2 – 1}}$$
$$\frac{d}{dx} \text{artanh}(x) = \frac{1}{1 – x^2}$$
$$\frac{d}{dx} \text{arcoth}(x) = \frac{1}{1 – x^2} $$
$$\frac{d}{dx} \text{arsech}(x) = \frac{-1}{x\sqrt{1 – x^2}}$$
$$\frac{d}{dx} \text{arcsch}(x) = \frac{-1}{|x|\sqrt{1 + x^2}}$$

In this section, you learned how to differentiate various functions. In the next section, we’ll use this knowledge to learn more advanced differentiation techniques, including the product, quotient, and chain rules, as well as implicit and logarithmic differentiation, which are valuable tools for finding derivatives of more complicated functions.

Advanced Differentiation

In this section, we’ll explore several powerful techniques for differentiation: the product rule, quotient rule, chain rules, implicit differentiation, and logarithmic differentiation. Don’t let the word “advanced” scare you. These techniques can be learned with practice.

Product Rule

The product rule is a technique to differentiate the product of two functions. If you have two functions, u and v, the product rule states

$$\frac{d}{dx}(uv) = u’v + uv’.$$

Let’s do an example.

Example 2: Differentiate the functions
(a) \(f(x) = (x^2 + 1)e^x\)
(b) \(g(x) = x^3\sin(x)\)

Solution: (a) \(f(x) = (x^2 + 1)e^x\)

Using the product rule, we find

$$f'(x) = (x^2 + 1)’e^x + (x^2 + 1)(e^x)’.$$

Applying the sum rule, we obtain

$$f'(x) = ((x^2)’ + (1)’)e^x + (x^2 + 1)(e^x)’.$$

Calculating the derivatives gives us

$$f'(x) = 2xe^x + (x^2 + 1)e^x.$$

Simplifying gives a final answer of

$$f'(x) = (x^2 + 2x + 1)e^x.$$

(b) \(g(x) = x^3\sin(x)\)

Using the product rule, we find

$$g'(x) = (x^3)’ \sin(x) + (x^3)(\sin(x))’.$$

Calculating the derivatives gives us a final answer of

$$g'(x) = 3x^2 \sin(x) + x^3 \cos(x).$$

Quotient Rule

As its name suggests, the quotient rule is used to differentiate the quotient of two functions. Given two functions, u and v, the quotient rule states:

$$\frac{d}{dx}\left[\frac{u}{v}\right] = \frac{u’v – uv’}{v^2}.$$

We now work on an example using the quotient rule:

Example 3: Find the derivative of \(y = \frac{\ln(x)}{x^2 + 1}.\)

Solution: Using the quotient rule, we find

$$\frac{dy}{dx} = \frac{(\ln(x))'(x^2 + 1) – \ln(x)(x^2+1)’}{(x^2 + 1)^2}.$$

Applying the sum rule, we obtain

$$\frac{dy}{dx} = \frac{(\ln(x))'(x^2 + 1) – \ln(x)((x^2)’ + (1)’)}{(x^2 + 1)^2}.$$

Calculating the derivatives gives us

$$\frac{dy}{dx} = \frac{(\frac{1}{x})(x^2 + 1) – 2x\ln(x)}{(x^2 + 1)^2}.$$

Simplifying by multiplying the numerator and denominator by x, we obtain a final answer of

$$\frac{dy}{dx} = \frac{x^2 + 1 – 2x^2\ln(x)}{x(x^2 + 1)^2}.$$

Chain Rule

The chain rule is used to differentiate composite functions. If you have a function y=f(g(x)), the chain rule states

$$\frac{dy}{dx} = f'(g(x)) \cdot g'(x).$$

Example 4: For Example, let’s differentiate \(f(x) = \ln(x^3 + 1).\).

Solution: Using the chain rule, we find

$$f'(x) = \frac{(x^3 + 1)’}{x^3+1}.$$

Next, we apply the sum rule to obtain

$$f'(x) = \frac{(x^3)’ + (1)’}{x^3+1}.$$

Calculating the derivatives, we arrive at a final answer of

$$f'(x) = \frac{3x^2}{x^3+1}.$$

Implicit Differentiation

Implicit differentiation is useful when you have an equation involving two variables. To differentiate a function implicitly, we first differentiate both sides of the equation, treating y as a function of x, and solve for \(\frac{dy}{dx}\). The best way to explain this procedure is with an example:

Example 5: Consider the equation of an ellipse centered at (0,0):

Solution: \(\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1\).

To find \(\frac{dy}{dx}\) implicitly, we start by differentiating both sides with respect to x to find

$$\frac{d}{dx}(\frac{x^2}{a^2} + \frac{y^2}{b^2}) = \frac{d}{dx}(1).$$

Applying the sum rule, we obtain

$$\frac{d}{dx}\frac{x^2}{a^2} + \frac{d}{dx}\frac{y^2}{b^2} = \frac{d}{dx}(1).$$

Next, we use the constant multiple rule to get

$$\frac{1}{a^2}\frac{d}{dx}(x^2) + \frac{1}{b^2}\frac{d}{dx}(y^2) = \frac{d}{dx}(1).$$

Differentiating gives us

$$\frac{2x}{a^2} + \frac{2y}{b^2}\frac{dy}{dx} = 0.$$

Now, we can solve for \(\frac{dy}{dx}​\). We begin by subtracting \( \frac{2x}{a^2} \) from both sides to find

$$\frac{2y}{b^2}\frac{dy}{dx} = -\frac{2x}{a^2}.$$

Multiplying both sides of the equation by \( \frac{b^2}{2y} \) we arrive at a final answer of

$$\frac{dy}{dx} = -\frac{b^2x}{a^2y}$$

Logarithmic Differentiation

Logarithmic differentiation is used to differentiate functions of the form \(f(x)^{g(x)}\) and can be used to simplify the process when dealing with products or quotients where applying the product or quotient rule would be too cumbersome. The idea is to take the natural logarithm of both sides of an equation, apply the rules of logarithms, and implicitly differentiate.

The next Example demonstrates these ideas:

Example 6: Differentiate the functions:
(a) \(y = x^x\)
(b) \(y = \frac{(x^2+ 6x+ 10)\ln{x}}{e^x\arctan{x}}\)

Solution: (a) \(y = x^x\)

Taking the natural logarithm of both sides gives

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

Next, applying logarithmic properties gives us

$$\ln(y) = x \ln(x).$$

Now, we differentiate both sides, which gives

$$\frac{d}{dx}\ln(y) = \frac{d}{dx}(x \ln(x)).$$

Using the chain rule on the left-hand side and the product rule on the right-hand side, we get

$$\frac{1}{y}\frac{dy}{dx} = \ln(x)\frac{d}{dx}x + x\frac{d}{dx}\ln(x).$$

Calculating the derivatives, we obtain

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

This is equivalent to

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

Multiplying both sides by y gives

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

Finally, substituting \(y = x^x\) we arrive at a final answer of

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

(b) \(y = \frac{(x^2+ 6x+ 10)\ln{x}}{e^x\arctan{x}}\)

Taking the natural logarithm of both sides of the equation gives

$$\ln y = \ln( \frac{(x^2 + 6x + 10) \ln x}{e^x \arctan x} ).$$

Using the identity \( \ln{\frac{a}{b}} = \ln{a} – \ln{b} \), we obtain

$$\ln y = \ln((x^2 + 6x + 10)\ln x) – \ln(e^x \arctan x).$$

Applying the identity \( \ln(ab) = \ln{a} + \ln{b} \), to each term we find

$$\ln y = \ln(x^2 + 6x + 10) + \ln(\ln x) – (\ln(e^x) + \ln(\arctan x)).$$

Distributing the minus sign, this is equivalent to

$$\ln y = \ln (x^2 + 6x + 10) + \ln (\ln x) – \ln (e^x) – \ln (\arctan x).$$

Simplifying gives

$$\ln y = \ln (x^2 + 6x + 10) + \ln (\ln x) – x – \ln (\arctan x).$$

Now, differentiate both sides to obtain

$$(\ln y)’ = (\ln (x^2 + 6x + 10) + \ln (\ln x) – x – \ln (\arctan x))’.$$

Applying the sum rule on the right-hand side, we get

$$(\ln y)’ = (\ln (x^2 + 6x + 10))’ + (\ln (\ln x))’ – (x)’ – (\ln (\arctan x))’.$$

Applying the chain rule, the power rule, and the differentiation formula for the natural logarithm gives

$$\frac{1}{y} \frac{dy}{dx} = \frac{(x^2 + 6x + 10)’}{x^2 + 6x + 10} + \frac{(\ln x)’}{\ln x} – 1 – \frac{( \arctan x )’}{\arctan x}.$$

Using the sum rule in the numerator of the first term on the right-hand side, we get

$$\frac{1}{y} \frac{dy}{dx} = \frac{(x^2)’ + (6x)’ + (10)’}{x^2 + 6x + 10} + \frac{(\ln x)’}{\ln x} – 1 – \frac{( \arctan x )’}{\arctan x}.$$

Applying the constant multiple rule to the 6x term, we find

$$\frac{1}{y} \frac{dy}{dx} = \frac{(x^2)’ + 6(x)’ + (10)’}{x^2 + 6x + 10} + \frac{(\ln x)’}{\ln x} – 1 – \frac{( \arctan x )’}{\arctan x}.$$

Calculating the derivatives, we obtain

$$\frac{1}{y} \frac{dy}{dx} = \frac{2x + 6}{x^2 + 6x + 10} + \frac{\frac{1}{x}}{\ln x} – 1 – \frac{\frac{1}{x^2 + 1}}{\arctan x}.$$

This is equivalent to

$$\frac{1}{y} \frac{dy}{dx} = \frac{2x + 6}{x^2 + 6x + 10} + \frac{1}{x\ln x} – 1 – \frac{1}{\arctan x(x^2 + 1)}.$$

Multiplying both sides by y gives​

$$\frac{dy}{dx} = y ( \frac{2x + 6}{x^2 + 6x + 10} + \frac{1}{x \ln x} – 1 – \frac{1}{(x^2 + 1) \arctan x} ).$$

Substituting y back gives a final solution of,

$$\frac{dy}{dx} = \frac{(x^2 + 6x + 10) \ln x}{e^x \arctan x} ( \frac{2x + 6}{x^2 + 6x + 10} + \frac{1}{x \ln x} – 1 – \frac{1}{(1 + x^2) \arctan x} ).$$

This section explored how the product, quotient, and chain rules help us differentiate various functions. We looked at implicit and logarithmic differentiation, both of which are useful for simplifying the process for more complicated functions. With these techniques, you can find the derivative of any elementary function.

Higher-Order Derivatives

So far, we’ve focused on finding the first derivative of a function, which tells us the rate of change or slope at any point. But what if we want to know how that rate of change is changing? That’s where higher-order derivatives come into play.

The second derivative, written as \( f”(x) \) or \( \frac{d^2y}{dx^2} \), is the derivative of the first derivative. It helps us understand the concavity of a graph, whether the curve opens upward or downward, and is a key tool in identifying local maxima and local minima.

Example 7: Find the second derivative of \( f(x) = x^4 + x^2 + 1 \).

Solution: To find the second derivative, we start by finding the first derivative. Applying the sum rule gives

$$f'(x) = (x^4)’ + (x^2)’ + (1)’.$$

Calculating the derivatives via the power rule and constant rule, we obtain

$$f'(x) = 4x^3 + 2x.$$

Differentiating again, the second derivative is

$$f”(x) = (4x^3 + 2x)’.$$

An application of the sum rule gives the result,

$$f”(x) = (4x^3)’ + (2x)’.$$

Using the constant multiple rule, we get

$$f”(x) = 4(x^3)’ + 2(x)’.$$

We now use the power rule to calculate the derivatives. This gives us a final answer of

$$f”(x) = 12x^2 + 2.$$

We can also compute derivatives of even higher order. Third-order derivatives have notation similar to second-order derivatives, while derivatives of order four or greater are denoted as \( f^{(n)}(x) \) or \( \frac{d^ny}{dx^n} \).

Conclusion

In this guide on how to differentiate a function step by step, we’ve explored the fundamental concepts of differentiation and introduced you to the tools necessary to differentiate elementary functions. We began with the basic principles of differentiation, including the definition and key rules such as the product, quotient, and chain rules. These rules are useful for breaking down complicated functions into manageable parts.

We then introduced implicit differentiation and logarithmic differentiation, two techniques for differentiating functions that may be too cumbersome to handle using other methods.

Understanding how to differentiate functions step by step is essential for anyone studying calculus. These concepts will become second nature with practice, allowing you to solve calculus problems skillfully.

Further Reading

Basic Integration Problems for Beginners – Now that you know about derivatives, you are ready to learn about integrals.

How to Calculate Limits in Calculus: Everything You Need to Know – You should know about limits before learning about derivatives. However, L’Hospital’s Rule is a powerful technique for computing limits that requires differentiation. This technique is covered in this article.

The Ultimate Beginner’s Guide to Partial Derivatives with Step-by-Step Examples – Partial derivatives are typically covered in multivariable calculus. However, you only need knowledge of single variable derivatives to understand partial derivatives.

Frequently Asked Questions

No. A function must be continuous and smooth at a point to have a derivative there. Loosely speaking, functions are nondifferentiable at points where there are sharp corners or discontinuities.

Use standard rules (power, product, quotient, chain) when applicable. If the function is implicitly defined, use implicit differentiation. Logarithmic differentiation may simplify the work for more complicated functions.