You have been asked to determine where a water works should be built along a river between Chesterville and Denton to minimize the total cost of the pipe to the towns.

(a) Assume that the same size (and cost) pipe is used to each town. (This part can be done quickly without using calculus.)
(b) Assume that the pipe to Chesterville costs $3000 per mile and to Denton it costs $7000 per mile.

As always, draw a diagram. Label the water works W. It sounds like C,W,D are in a straight line. If so, there is really very little calculus involved here. In fact, the least cost pipeline is to build it right at D. If C and D are x miles apart, and W is y miles from C, then the cost (in 000's) is

c(x) = 3x + 7(y-x)
dc/dx = 3 - 7

Somehow I think there is something you left out of the problem.

(a) To determine where the water works should be built along the river between Chesterville and Denton to minimize the total cost of the pipe, we need to find the halfway point.

The total distance between Chesterville and Denton can be represented as D miles.

Since the halfway point will minimize the total cost, we can simply divide D by 2 to find the optimal location for the water works.

Therefore, the water works should be built at a distance of D/2 miles from Chesterville.

(b) To determine the optimal location considering different costs for the pipes to Chesterville and Denton, we can use calculus.

Let's denote the distance between Chesterville and Denton as D miles, and let x denote the distance in miles from Chesterville to the water works location.

The cost of the pipe to Chesterville is $3000 per mile, and the cost of the pipe to Denton is $7000 per mile.

The cost function for the total pipe cost is given by:

Cost(x) = (3000 * x) + (7000 * (D - x))

To minimize this cost function, we need to find the critical points by taking the derivative:

Cost'(x) = 3000 - 7000

To find the critical point, we set Cost'(x) = 0 and solve for x:

3000 - 7000 = 0
-4000 = 0
x = 4000/7000

Since the distance from Chesterville to the water works cannot be negative, we can discard the negative solution.

Therefore, the water works should be built at a distance of (4000/7000) * D miles from Chesterville, or approximately 0.57 * D miles from Chesterville.

To determine where the water works should be built along the river to minimize the total cost of the pipe to the towns, we need to compare the cost of building the pipe to each town separately.

(a) Assuming the same size and cost of a pipe is used to each town, we can calculate the total cost of the pipe to each town by multiplying the cost per mile by the distance from the river to each town.

Let's say the distance from the river to Chesterville is x miles and the distance from the river to Denton is y miles. The total cost of the pipe to Chesterville would be $3000 times x, and the total cost of the pipe to Denton would be $3000 times y.

To minimize the total cost, we need to find the values of x and y that minimize the sum of the two costs.

(b) Assuming the pipe to Chesterville costs $3000 per mile, and the pipe to Denton costs $7000 per mile, we still need to find the distances x and y, but now we need to incorporate the different costs per mile.

Let's denote the cost function as C(x, y) where x is the distance from the river to Chesterville and y is the distance from the river to Denton. The cost function can be calculated as follows:

C(x, y) = $3000 * x + $7000 * y

Our goal is to minimize this cost function with respect to x and y.

To find the optimal location for the water works, we could use techniques such as graphical analysis or optimization algorithms like gradient descent. However, since this question can be done quickly without using calculus, we can find the solution using an intuitive approach:

1. Start by considering extreme scenarios:
a. If x = 0 (the water works is built right at Chesterville), the cost would be $3000 * 0 + $7000 * y = $7000 * y.
b. If y = 0 (the water works is built right at Denton), the cost would be $3000 * x + $7000 * 0 = $3000 * x.

2. Compare the costs from the two scenarios:
- If $7000 * y < $3000 * x, it is more cost-effective to locate the water works closer to Chesterville.
- If $7000 * y > $3000 * x, it is more cost-effective to locate the water works closer to Denton.
- If $7000 * y = $3000 * x, both costs are equal, so it doesn't matter where the water works is located along the river.

Based on these comparisons, you can determine the optimal location for the water works to minimize the total cost of the pipe to the towns.