Insane, out of control boat problem I had this problem on my Calc 1 exam today and found it to be a bit difficult. I'll walk you through the problem and my attempt at solving it, hopefully you guys will be able to help me!
At noon, boat A is 20 miles west of boat B. Boat A is traveling north at 6 mph and boat B is traveling east at 4 mph. At 5:00 PM, what is the rate at which the distance between the two boats is changing?

I sketched up this beautiful diagram: 
https://i.imgur.com/orwcKH7.jpg (Sorry, I can't embed images yet)

And I then tried to use the distance formula to solve this problem
$$d = \sqrt{(y_2-y_1)^2 + (x_2-x_1)^2}$$
$$d = \sqrt{(0-6t)^2 + (4t + 20)^2}$$
$$= \sqrt{52 t^2+160 t+400}$$
But when I try to derive $\frac{dd}{dt}$ to get the rate of change in distance with respect to time, sh*t starts getiting funky af. Can someone tell me where I'm going wrongwith this? Thank you!
 A: The distance function between $A$ and $B$ at time $t$ is given by $$L(t) = \sqrt{(6t)^2 + (4t + 20)^2} = 2\sqrt{13t^2 + 40t + 100}.$$  It follows that $$\frac{dL}{dt} = \frac{26t + 40}{\sqrt{13t^2+40t+100}}.$$  When $t = 5$ hours, this is simply $$L'(5) = \frac{34}{5} = 6.8 \text{ mi/hr}.$$
A: I would recommend drawing a picture of where the ships are at noon and where they are and at 5:00 PM.  Your second picture should be a right triangle with side lengths:
$$a=6 \ \frac{mi}{h}*5 \ h = 30 \ mi,$$
$$b=20 \ mi + \bigg(4 \ \frac{mi}{h} * 5 \ h\bigg) = 40 \ mi.$$
Then use Pythagorean Theorem to find the hypotenuse. 
$$c^2=a^2+b^2$$
$$c^2=30^2+40^2$$
$$c^2=2,500$$
$$c=50 \ mi$$
You also know that $\frac{da}{dt}=6\frac{mi}{h}$ because ship A is moving $6\frac{mi}{h}$ and making side $a$ larger as it moves.  Similarly, $\frac{db}{dt}=4\frac{mi}{h}$ because side $b$ of your triangle is growing at that rate.
Now all you need to do is differentiate the Pythagorean Theorem with respect to time, solve for $\frac{dc}{dt}$, and plug in the other values.
$$c^2=a^2+b^2$$
$$2c\frac{dc}{dt}=2a\frac{da}{dt}+2b\frac{db}{dt}$$
$$c\frac{dc}{dt}=a\frac{da}{dt}+b\frac{db}{dt}$$
$$\frac{dc}{dt}=\frac{a\frac{da}{dt}+b\frac{db}{dt}}{c}$$
$$\frac{dc}{dt}=\frac{30*6+40*4}{50}=6.8 \ \frac{mi}{h}$$
Here's a link to a site with a much more detailed explanation of how to solve a problem like this.  This site has a good explanation of how to draw your picture and go through the problem.  
https://jakesmathlessons.com/derivatives/related-rates/
