Problems very similar to this one can be found by googling. This is a very cliche calculus problem. One can find it in some form or another online or in any calc book.
First, draw a picture. Note, there is a right triangle which the hypoteneuse represents the length of cable under water across the river. See it?.
Let the portion along the bank, on land, be 1500-x.
The cost on land is 30(1500-x) and the cost underwater is
Then, the total cable cost will be
This is what must be optimized to find the length across land and under the water. Differentiate, set to 0, and solve for x. Look at the diagram I have provided. See what is going on?.