Jorge Valle

Jorge Valle

Jorge Valle is a front end developer with a particular passion for, and expertise in, JavaScript and user interfaces. Lately, he's also been diving into machine learning.

The sum rule in differential calculus

The sum rule

Whenever we have a function that adds up other functions, and we want to find the derivative of the larger function, we can use the sum rule. The sum rule states that the derivative of the sums is equal to the sum of the derivatives.

Said another way, we can either add up the functions together first - and then differentiate them - or we can differentiate them separately and then add them up. The result will be the same: the approach is said to be interchangeable.

Here's the formal definition.

$$ (f(x) + g(x))' = f'(x) + g'(x) $$
Figure 1: The sum rule defined.

An example of the sum rule

Let's start with two simple functions.

$$ f(x) = x^3 \\ g(x) = 4x^3 $$
Figure 2: The functions we'll be using.

We differentiate them individually using the power rule.

$$ f'(x) = 3x^2 \\ g'(x) = 4 \times 3x^2 = 12x^2 $$
Figure 3: Straightforward differentiation.

Then add up the individual derivatives, per the sum rule.

$$ f'(x) + g'(x) = 3x^2 + 12x^2 = 15x^2 $$
Figure 4: Adding up the derivatives.

The derivative we arrived at from the sum rule is $ 15x^2 $.

Now lets try the other approach: add up the functions first and then differentiate them. For the rule to hold true, we should arrive at the same result.

$$ f(x) + g(x) = x^3 + 4x^3 = 5x^3 \\ (5x^3)' = (3 \times 5x^{3-1}) = 15x^2 $$
Figure 5: Reaching the same results the other way.

We arrive at the same result.

Panoramic view of the port of Rijeka, Croatia's largest