# Calculating df/dt using the chain rule

1. Dec 28, 2013

### noelo2014

Hello everyone, first post here.

1. The problem statement, all variables and given/known data
Let f(x,y)=x2y+y2x , where x=sin2t
and y=cos2t.

Use the chain rule to compute df/dt

2. Relevant equations

f(x,y)=x2y+y2x

x=sin2t
y=cos2t

3. The attempt at a solution

This is pretty much the exact wording of the question, it's a little vague, and I'm not sure if I'm supposed to sub in sin2t and cos2t in the f(x,y) equation

I did it by calculating the partial derivatives of f with respect to x and y thus finding the gradient of f, I then found the gradient at any time t by subbing in the x/y equations above into the gradient,

I then calculated dx/dt and dy/dt to give the velocity vector in the x/y plane.

Finally I calculated the dot product of this velocity vector and the gradient vector and ended up with a pretty long equation as my answer: 2 sin(t)cos(t)(cos4t-sin4t).

I'm pretty sure this is the correct answer assuming my method and interpretation of the question is right. However I'm wondering if I could have taken a short-cut by initaially subbing in the x/y functions into f thus making f(x,y) into f(t), differentiating it with respect to t.

I did this (in Maple), and ended up with a different answer which gave a different answer when I substituted in an arbitrary value for t. I'm finding it quite hard to visualize this question and I hope someone can help shed some light on it (exam January)

Thanks!

2. Dec 28, 2013

### Tanya Sharma

Hi noelo2014...

Welcome to PF!!!

By the way your answer 2sintcost(cos4t-sin4t) can be written in different ways .

2sintcost(cos4t-sin4t) = 2sintcost(cos2t-sin2t) = sin2tcos2t = (1/2)sin4t .

3. Dec 28, 2013

### PeroK

It will be a lot easier if you substitute the functions of t into the equation.

4. Dec 28, 2013

### Ray Vickson

So, you used
$$\frac{df}{dt} = \frac{\partial f(x,y)}{\partial x} \frac{dx}{dt} + \frac{\partial f(x,y)}{\partial y} \frac{dy}{dt}$$
Woulddn't it have been more revealing to just write the formula instead of describing it in English? (If you don't like using LaTeX you can write it in ASCII as df/dt = f_x*(dx/dt) + f_y*(dy/dt), etc.)
Anyway, if you do everything correctly you will get the correct answer.

Your answer is equivalent to the one I got in Maple (which might be the same one you got in Maple, but you did not tell us what that was)! In other words, if you play around with trigonometric identities, etc., you should be able to show they are the same.

5. Dec 28, 2013

### noelo2014

Thanks for the quick replies.

I'm mainly trying to develop a good intuition for these questions, When I originally read the question I visualized a wavy surface, with the height denoted by the value of the f(x,y) function.

when I saw the x=sin2t y=cos2t I thought "Ok I'm moving along a path on top of this surface, my x/y coordinates are determined by the time (t), and my height is denoted by my x/y coordinates therefore my height is determined by the time (t).

(I realize this is like playschool math to many of you guys reading this, but bare with me).

I did some problems the other day about motion along a curve and the way I solved them was

1. Find the gradient of the surface (let's call this equation G)

2. Find the gradient at any time t by substituting the x(t) and y(t) functions in for x and y respectively into the equation G (from my limited understanding of calculus this will tell me the direction I need to be facing at any time t in order to have the steepest ascent in front of me, assuming I'm already standing on the point on the curve where I'm supposed to be).

3. Find the derivatives of the x/y equations with respect to t (dx/dt and dy/dt). This will tell me how fast and in what direction I'm travelling in the x direction and how fast and in what direction I'm travelling in the y direction.

4. Calculate the dot product of (2) and (3) which will give my rate of change in height (z) per unit time (t) at my current position, in my current direction. From what I know, if the way I'm currently moving is in a similar direction to the direction of steepest ascent the rate of change will be high and positive whereas if they're in opposite directions it will be high but negative

My question is: Instead of this method, can I just substitute sin2t in place of x and cos2t in place of y in x2y+y2z , thus eliminating the x/y coordinates and just directly finding my height (z) from any given t, thus giving me a short-cut to the rate of change? Although I don't know where I am in the XY plane or in what direction I'm facing I do know the rate at which I'm getting higher or lower, as long as I know what time it is?

(Sorry if this sounds childish)

I realize one person (PeroK) has already told me this will work, the point is I've already tried it and got a different answer although it's very likely I made a mistake somewhere. I can check it again later. At the moment I'm more concerned with just getting a good feel for the calculus and wordy analogy's are highly welcome.

Appreciate any help

Last edited: Dec 28, 2013
6. Dec 28, 2013

### haruspex

It will be much easier to help you find where you have gone wrong if you post the detailed working for both methods.

7. Dec 28, 2013

### noelo2014

The detailed work is all on paper/unsaved. I'm not doing any more calculus today, I'll post it tomorrow if I don't get get a good answer or figure it out for myself. BTW this isn't homework, it's a question from a previous exam paper in my Calculus 3 course. I'm doing my exam in January :)

8. Dec 28, 2013

### PeroK

You definitely should substitute and simplify before you differentiate. Note that:

$f(x,y)=xy(x+y)$

And that gives you a big hint on how to simplify things before you get started!

9. Dec 28, 2013

### LCKurtz

I would add that, if you are doing problems in a section where you are learning the chain rule, it is self-defeating to substitute and simplify before differentiating. You get used to using the chain rule by using it. After you have mastered the chain rule, then you can worry about whether substituting first would have been easier.

10. Dec 28, 2013

### noelo2014

I did this problem in Maple (both ways), here's the output (don't know if this will come out right)
I had terrible problems with exporting this from maple, even harder than doing the maths itself, I had to take a screenshot... anyway here it is.

I guess either way is correct.

Yep, both ways seem to work although the direct substitution method is a lot faster

Interesting and tiring problem. My brain needs a rest, thanks for the replies everyone

Last edited: Dec 28, 2013
11. Dec 28, 2013

### Ray Vickson

You should get the same answer using either method---that is, if you substitute x = sin(t)^2 and y = cos(t)^2 right away into f(x,y), you will have some function F(t) that you can deal with directly. You keep saying you get a different answer that way, but you keep refusing to tell us what that answer actually IS---so how can we possibly help you?

12. Dec 28, 2013

### noelo2014

see my previous post

13. Dec 28, 2013

### Staff: Mentor

That's true, but LCKurtz makes an important point, below.

I agree 100% with LCKurtz's comments. In the first post of this thread, it says "Use the chain rule to compute df/dt". I would also recommend against using Maple or the like to do the actual work. Possibly you used Maple to confirm what you did manually, but that wasn't crystal clear to me.

14. Dec 29, 2013

### noelo2014

Yes.

I'm not using maple to do my work, I'm using it to check my work. I'm studying for a calculus exam in January. I did the problem both ways with maple and (beforehand) on paper using the chain rule.

I'm not using maple to do homework, nor would I. In fact I usually find it easier to work it out on paper since I find maple such a frustrating piece of software. If you read my posts I said that I was having trouble visualizing this problem and Intuitionizing (?) it. I was hoping for someone to post something enlightening that would help. that's all.

15. Dec 29, 2013

### ehild

Doing the direct substitution, see Perok's hint in Post #8. f(x,y)=xy(x+y) You should recognize that x+y =sin2t+cos2t =1.

ehild

16. Dec 29, 2013

### noelo2014

Thanks, I didn't realize that

So the problem becomes f(x,y) = xy

-> f(t) =sin2t cos2t

-> df/dt= (d/dt(sin2t))(cos2t) + (sin2t)((d/dt)cos2t)

-> df/dt= (2 sin(t) cos(t) )(cos2t) + (sin2t)(-2 cos(t) sin(t))

= 2 sin(t)cos(t) ((cos2t) - (sin2t))

..not using maple:)
I think this is right, let me check...
(this is much easier on paper)
...
anyway thanks. I'm learning

Edit: checked that... correct, and yet another way to write the answer

Last edited: Dec 29, 2013
17. Dec 29, 2013

### LCKurtz

And while you are at it, simplify it some more:$$\sin^2(t)\cos^2(t) = (\sin(t)\cos(t))^2=(\frac 1 2 \sin(2t))^2=\frac {\sin^2(2t)} 4$$Differentiate that using the chain rule.

18. Dec 29, 2013

### PeroK

$... f(t) = \frac14 sin^2(2t) = \frac18 (1 - cos(4t))$

Almost avoids using the chain rule at all!

19. Dec 29, 2013

### vela

Staff Emeritus
As long as you're trying different approaches, you could also use
$$f(x,y) = x^2y + xy^2 = \frac{1}{3}[(x+y)^3 - x^3 - y^3] = \frac{1}{3}(1 - x^3 - y^3).$$

20. Dec 29, 2013

### ehild

There are some very important trigonometric equations to keep in mind.

$$\cos^2(x)+\sin^2(x)=1$$
$$\cos^2(x)-\sin^2(x)=\cos(2x)$$
$$2\sin(x)\cos(x)=\sin(2x)$$

$$\frac{1-\cos(2x)}{2}=\sin^2(x)$$
$$\frac{1+\cos(2x)}{2}=\cos^2(x)$$

ehild