,

# Operations with Derivatives

So far we've seen how to differentiate a function that was made of one single term, like $$f(x)=3x^4$$, for which $$f'(x)=12x^3$$.
But what if we had to differentiate a function that had 2, or 3, or more, terms?

For instance, how would we differentuate the function: $y = 3x^5+4x^2$ which consists of 2 terms being added?

## Differentiating Sums & Differences

Given two functions $$f(x)$$ and $$g(x)$$, to differentiate their sum, or their difference, we differentiate each of them terms as though they were on their own: $\begin{pmatrix} f(x) \pm g(x) \end{pmatrix}' = f'(x) \pm g'(x)$ In other words the derivative of the sum, or the difference, of two functions is equal to the sum, or the difference, of the derivatives of each of the two functions.

## Example

Differentiate each of the following functions with respect to $$x$$:

1. $$f(x)=4x^5+7x$$
2. $$y=2x^3-2\sqrt{x}$$
3. $$f(x)=\frac{3}{x} + x^4-7$$

### Solution

Using the fact that the derivative of any sum, or difference, of two functions equals to the sum, or difference, of the derivatives of those functions, we differentiate each of the two terms treating each one as if it were on its own.

1. The derivative of $$f(x)=4x^5+7x$$ is: \begin{aligned} f'(x) &= 5\times 4x^{5-1}+7x^{1-1} \\ &= 20x^4+7x^0 \\ f'(x) &= 20x^4+7 \end{aligned}
2. Remembering that $$\begin{pmatrix} \sqrt{x} \end{pmatrix}' = \frac{1}{2\sqrt{x}}$$, the derivative of $$y=2x^3-2\sqrt{x}$$ is: \begin{aligned} \frac{dy}{dx} &= 3\times 2x^{3-1} - 2\times \frac{1}{2\sqrt{x}} \\ &= 6x^2-\frac{2}{2\sqrt{x}} \\ & = 6x^2 - \frac{1}{\sqrt{x}} \end{aligned}
3. Remembering that $$\begin{pmatrix} \frac{1}{x} \end{pmatrix}' = - \frac{1}{x^2}$$, we differentiate $$f(x) = \frac{3}{x^2} + x^4 - 7$$ as follows: $f'(x) = -\frac{3}{x^2} + 4x^{4-1} - 0 = -\frac{3}{x^2} + 4x^{3}$

## Differentiating Functions Multiplied by a Scalar

Given a function $$f(x)$$ and a scalar $$\alpha \in \mathbb{R}$$ (a real number) the derivative of the product $$\alpha f(x)$$ equals to the product of $$\alpha$$ and the derivative $$f'(x)$$.

That's: $\begin{pmatrix} \alpha f(x) \end{pmatrix}' = \alpha f'(x)$ Put simply: when we differentiate a function that is being multiplied by a number, the result is the derivative of that function multiplied by that same number.

### Differentiating Linear Combinations of Functions

Given two functions $$f(x)$$ and $$g(x)$$ as well as two scalars $$\alpha$$ and $$\beta$$ both in $$\mathbb{R}$$, the derivative of any linear combination of $$f(x)$$ and $$g(x)$$ equals to the same linear combination of their derivatives.
That's: $\begin{pmatrix} \alpha f(x) + \beta g(x) \end{pmatrix}' = \alpha f'(x) + \beta g'(x)$

## Example

Given $$f(x)=x^3$$, $$g(x)=\sqrt{x}$$ and $$h(x) = \frac{1}{x^2}$$, differentiate each of the following:

1. $$3f(x)+4g(x)$$
2. $$g(x)-6h(x)$$
3. $$\frac{5}{6}f(x)+\frac{1}{8}h(x)-\frac{3}{4}g(x)$$

### Solution

1. Remembering that $$\frac{1}{x^2} = x^{-2}$$ so $$\begin{pmatrix} \frac{1}{x^2} \end{pmatrix}'= -2x^{-2-1} = -2x^{-3}$$, we differentiate as follows: \begin{aligned} \begin{pmatrix} 3f(x)+4g(x) \end{pmatrix}' &= 3f'(x) +4g'(x) \\ & = 3\times 3x^{3-1} + 4\times (-2)x^{-2-1} \\ & = 9x^2 - 8 x^{-3} \\ \begin{pmatrix} 3f(x)+4g(x) \end{pmatrix}' & = 9x^2-\frac{8}{x^3} \end{aligned}
2. Remembering that $$\begin{pmatrix} \sqrt{x} \end{pmatrix}' = \frac{1}{2\sqrt{x}}$$, we differentiate as follows: \begin{aligned} \begin{pmatrix} g(x)-6h(x) \end{pmatrix}' &= g'(x) - 6h'(x) \\ & = \frac{1}{2\sqrt{x}} - 6\times (-2)x^{-2-1} \\ & = \frac{1}{2\sqrt{x}} + 12x^{-3} \\ \begin{pmatrix} g(x)-6h(x) \end{pmatrix}' &= \frac{1}{2\sqrt{x}} + \frac{12}{x^3} \end{aligned}
3. To differentiate $$\frac{5}{6}f(x)+\frac{1}{8}h(x)-\frac{3}{4}g(x)$$, we use all that we have seen here to write: \begin{aligned} \begin{pmatrix} \frac{5}{6}f(x)+\frac{1}{8}h(x)-\frac{3}{4}g(x) \end{pmatrix}' &= \frac{5}{6}f'(x)+\frac{1}{8}h'(x)-\frac{3}{4}g'(x) \\ &= 3\times \frac{5}{6} x^{3-1} -2\times \frac{1}{8}x^{-2-1} - \frac{3}{4} \times \frac{1}{2}\sqrt{x} \\ & = \frac{15}{6}x^2-\frac{2}{8}x^{-3} - \frac{3}{8\sqrt{x}} \\ & = \frac{15}{6}x^2-\frac{1}{4}\frac{1}{x^3} - \frac{3}{8\sqrt{x}} \\ \begin{pmatrix} \frac{5}{6}f(x)+\frac{1}{8}h(x)-\frac{3}{4}g(x) \end{pmatrix}' & = \frac{5}{2}x^2-\frac{1}{4x^3} - \frac{3}{8\sqrt{x}} \end{aligned}