One last optimization problem! Island problem

A small island is 3 miles from the nearest point P on the straight shoreline of a large lake. If a woman on the island can row a boat 2 miles per hour and can walk 3 miles per hour, where should the boat be landed in order to arrive at a town 12 miles down the shore from P in the least time? Let http://math.webwork.rochester.edu:80...dd0b8b8e91.png be the distance between point P and where the boat lands on the lakeshore. Hint: time is distance divided by speed.

(A) Enter a function http://math.webwork.rochester.edu:80...5f00db3091.png that describes the total amount of time the trip takes as a function of the distance http://math.webwork.rochester.edu:80...dd0b8b8e91.png.

http://math.webwork.rochester.edu:80...5f00db3091.png = (sqrt(x^2+9))/2+(12-x)/3

(B) What is the distance http://math.webwork.rochester.edu:80...0132efa521.png that minimizes the travel time? Note: The answer to this problem requires that you enter the correct units.

http://math.webwork.rochester.edu:80...a5a871d121.png = .

(C) What is the least travel time? Note: The answer to this problem requires that you enter the correct units.

The least travel time is .

(D) Recall that the second derivative test says that if http://math.webwork.rochester.edu:80...68bec67fa1.png and http://math.webwork.rochester.edu:80...2e3522e971.png, then http://math.webwork.rochester.edu:80...1e90188431.png has a local minimum at http://math.webwork.rochester.edu:80...a5a871d121.png. What is http://math.webwork.rochester.edu:80...f437a65f71.png?

http://math.webwork.rochester.edu:80...f437a65f71.png =

I got the first one, which is (sqrt(x^2+9))/2+(12-x)/3

also how do I derive that? do I used chain rule for the first function?