I have already discuss the product rule, quotient rule, and chain rule in previous lessons. But I wanted to show you some more complex examples that involve these rules. The reason for this is that there are times when **you’ll need to use more than one of these rules in one problem.** So let’s dive right into it!

## Example 1

Find the derivative of \(y \ = \ sin(x^2 \cdot ln \ x)\).

At first glance of this problem, the first thing we should notice is that we can think of this function as one function plugged into another. There is a clear inner function and a clear outer function.

It can be broken down as \(x^2 \cdot ln \ x\) being plugged into *sin(x) *for *x*. **Since our function can be thought of as one function plugged into another, we will want to start out with the ****chain rule****.**

### Chain rule

The first thing we need to do to apply the chain rule is to figure out our inside function and outside function. It’s usually easier to think about the insider function first.

#### Finding *f* and *g*

To find the inside function we just need to answer the question: **what function is being plugged into another?**

Looking at our function you can see that we are taking \(x^2 \cdot ln \ x\) and plugging that into another function. So we will say $$g_1(x) = x^2 \cdot ln \ x$$

Now that we have decided on the inside function, we need to find the outside function. **All we need to do here is look at the original function, and replace our inside function with a single ****x****.** So we will replace \(x^2 \cdot ln \ x\) with just *x*. This gives us $$f_1(x) = sin(x).$$

#### Finding *f’* and *g’*

Now that we have found *f* and *g*, we just need to take each of their derivatives to find* f’* and *g’*.

Finding *f’ *should be simple here. $$f’_1(x) = cos(x)$$

Finding *g’ *will be a little more tricky.

Looking at our function \(g_1(x)\) you can see that it is actually the product of two simpler functions, \(x^2\) and \(ln \ x\). **Therefore, we are going to have to use the product rule to find this derivative. **You can kind of think of this as a smaller sub-problem within our problem, so we will come back to the chain rule after applying the product rule.

### Product rule

We need to use the product rule to find the derivative of $$g_1(x) = x^2 \cdot ln \ x.$$ The product rule starts out similarly to the chain rule, finding* f* and *g*. However, this time I will use \(f_2(x)\) and \(g_2(x)\).

#### Finding *f *and *g*

With the product rule it doesn’t really matter which function is *f* and which is* g*. As long as we correctly identify that our function is a product of two simpler functions, it’ll work out correctly. So we will say $$f_2(x) = x^2$$ $$g_2(x) = ln \ x.$$

#### Finding* f’* and *g’*

Now we just need to find the derivatives of *f* and *g*. Since they are fairly simple functions, this shouldn’t be too difficult.

To find the derivative of *f* we just need to use the power rule. $$f’_2(x) = 2x.$$

And finding the derivative of g should be a derivative that you have memorized. Using Wolfram Alpha we can see that $$g’_2(x) = \frac{1}{x}.$$

#### Plugging into the formula

Now that we have found all the pieces we need, we can simply plug them all into the product rule formula. $$g’_1(x) = f_2(x) \cdot g’_2(x) \ + \ f’_2(x) \cdot g_2(x)$$ $$\frac{d}{dx} \Big[ x^2 \cdot ln \ x \Big] \ = \ x^2 \cdot \frac{1}{x} \ + \ 2x \cdot ln \ x$$ $$\frac{d}{dx} \Big[ x^2 \cdot ln \ x \Big] \ = \ x \ + \ 2x \cdot ln \ x$$

### Back to chain rule

Now that we know the derivative of \(x^2 \cdot ln \ x\) we can go back up to the chain rule. We knew that $$g_1(x) = \ x^2 \cdot ln \ x$$ and by using the product we just found that $$g’_1(x) = \ x \ + \ 2x \cdot ln \ x.$$ Just as a quick reminder, we already found that $$f_1(x) = sin(x)$$ $$f’_1(x) = cos(x).$$ Now we just need to plug these four pieces into the formula for chain rule. $$h’_1(x) = \ f’_1 \big( g_1(x) \big) \cdot g’_1(x)$$ $$\frac{d}{dx} \Big[ sin \big(x^2 \cdot ln \ x \big) \Big] \ = \ cos \big( x^2 \cdot ln \ x \big) \cdot \big( x \ + \ 2x \cdot ln \ x \big)$$

And that’s it! We could factor out a like term out of one of these factors, but it wouldn’t really make the function any simpler so I won’t do that. We can also use Wolfram Alpha to check our answer. **A quick note on that, Wolfram Alpha uses ****“log”**** instead of ****“ln”**** to describe a natural log.**

## Example 2

Find the derivative of \(y = \frac{x \ sin(x)}{ln \ x}\).

Looking at this function we can clearly see that we have a fraction. Therefore, we can break this function down into two simpler functions that are part of a quotient. So we can see that we will need to use quotient rule to find this derivative.

### Quotient rule

As discussed in my quotient rule lesson, when we apply the quotient rule to find a function’s derivative we need to first determine which parts of our function will be called *f *and *g*.

#### Finding *f *and *g*

With the quotient rule, it’s fairly straight forward to determine which part of our function will be *f *and which part will be *g*. **We will always say ****f ****is the numerator (top of our fraction) and ****g ****is the denominator (bottom of our fraction). **So we can say $$f_1(x) \ = \ x \ sin(x)$$ $$g_1(x) \ = ln \ x.$$

#### Finding *f’* and *g’*

Once we have determined which part of our function we are going to call *f *and which part will be *g*, we need to take each of their derivatives so we can use the quotient rule formula.

First we’ll start with finding *f’*. To find this we need to find the derivative of \(f_1(x)= x \ sin(x)\). Notice this function is actually a product of two simpler functions. **So in order to find** \(\mathbf{f’_1(x)}\)** we will actually need to use ****the product rule****.** This will create a smaller sub-problem for us so we will need to come back to the quotient rule in a moment.

### Product rule

As we did in the previous example, or in my product rule lesson, we need to start by determining which piece of the function \(f_1(x) = x \ sin(x)\) will be \(f_2\) and which will be \(g_2\).

#### Finding *f *and *g*

When using the product rule it doesn’t really matter which piece of the product is called *f *and *g*. So we will say $$f_2(x) = x$$ $$g_2(x) = sin(x).$$

#### Finding *f’* and *g’*

In order to use the product rule formula, we need to find the derivative of each of these pieces now. Fortunately, both of these pieces are simple functions to differentiate. $$f’_2(x) = 1$$ $$g’_2(x) = cos(x)$$

#### Plugging into the formula

Now we just need to plug the four pieces we’ve found into the product rule formula. $$f’_1(x) = \ f_2(x) \cdot g’_2(x) \ + \ f’_2(x) \cdot g_2(x)$$ $$\frac{d}{dx} \Big[ x \ sin(x) \Big] \ = \ x \cdot cos(x) \ + \ 1 \cdot sin(x)$$ $$\frac{d}{dx} \Big[ x \ sin(x) \Big] \ = \ x \ cos(x) \ + \ sin(x)$$

### Back to the quotient rule

Now that we have used the product rule to find $$f’_1(x) = \ x \ cos(x) \ + \ sin(x)$$ we need to find \(g’_1(x)\) so we can use the quotient rule formula. Remember \(g_1(x) = ln \ x\), which is a function whose derivative you should memorize. $$g’_1(x) = \frac{1}{x}.$$ So now we know all of the pieces we need to apply the quotient rule formula.

$$h'(x) \ = \ \frac{f’_1(x) \cdot g_1(x) \ – \ f_1(x) \cdot g’_1(x)}{g^2_1(x)}$$ $$\frac{d}{dx} \Bigg[ \frac{x \ sin(x)}{ln \ x} \Bigg] \ = \ \frac{ \Big[ \big( x \ cos(x) + sin(x) \big) \cdot ln \ x \Big] \ – \ \Big[ x \ sin(x) \cdot \frac{1}{x} \Big]}{\big( ln \ x \big)^2}$$

And now we can just simplify by distributing through all of our parenthesis.

$$\frac{d}{dx} \Bigg[ \frac{x \ sin(x)}{ln \ x} \Bigg] \ = \ \frac{ x \ ln(x) \ cos(x) \ + \ ln(x) \ sin(x) \ – \ sin(x)}{ln^2(x)}$$

And that’s the answer! Again, we can check this using Wolfram Alpha.

If you have any questions on any of this just let me know! You can email me at jakesmathlessons@gmail.com. **You can also use the contact form below and I’ll add you to my email list and send you my calculus 1 study guide to help you boost your calculus scores!** I’d also love to hear any suggestions for future posts so please don’t hesitate to reach out to me. If you want some more practice with derivatives go check out my other lessons and problems related to derivatives.