We know this is a piecewise function and we solved the first part, but we cannot figure out the other equation.

A passenger ship leaves port sailing east at 16 mph. Two hours later, a cargo ship leaves the same port heading north at 12 mph.
(a) Find a function giving the distance in miles between the two ships t hr after the passenger ship leaves port.

D(t)={16t if 0<t<4
={??? if t>2

passenger ship east = 16 t

if t</= 2 then 16 t is the answer

if t >2
cargo ship north = 12 (t-2) (t>2 :)

d^2 = (16t)^2 + 144(t^2 -4 t + 4)
d^2 = 256 t^2 + 144 t^2 -576 t + 576

d^2 = 400 t^2 -576 t + 576
d = sqrt (400 t^2 -576 t + 576)
check, yes that is 32 miles at t = 2 :)

To find the function for the distance between the ships for t>2, we need to analyze the situation. From the problem statement, we know that the passenger ship leaves the port initially at a speed of 16 mph and sails east. Two hours later, the cargo ship leaves the same port heading north at a speed of 12 mph.

Let's consider the time when the cargo ship starts sailing, which is t=2 hours. At this time, the passenger ship will already be on its way east for 2 + 2 = 4 hours, since it started 2 hours earlier and its speed is 16 mph.

Now, if we draw a diagram, we can see that the two ships will form a right triangle with the distance between them as the hypotenuse. The distance covered by the cargo ship (sailing north at 12 mph) can be represented as 12(t - 2) miles, where t is the time in hours. Similarly, the distance covered by the passenger ship (sailing east at 16 mph) can be represented as 16(t - 4) miles, since it started 2 hours earlier.

To find the hypotenuse (distance between the two ships) using the Pythagorean theorem, we can square the distance covered by the cargo ship and the passenger ship, and then take the square root of their sum:

Distance^2 = (12(t - 2))^2 + (16(t - 4))^2

We square the distances covered by each ship because they are perpendicular to each other, and we need to find the hypotenuse (distance between them).

To simplify the equation, we can expand the squares and combine like terms:

Distance^2 = 144(t^2 - 4t + 4) + 256(t^2 - 8t + 16)
= 144t^2 - 576t + 576 + 256t^2 - 2048t + 4096
= 400t^2 - 2624t + 4672

Finally, taking the square root of both sides gives us the distance function for t>2:

D(t) = sqrt(400t^2 - 2624t + 4672)

Therefore, the function for the distance between the two ships, when t>2, is D(t) = sqrt(400t^2 - 2624t + 4672).