You have a problem with this problem. When a curve and a line are tangent, they both must pass through one common point. Your line, 3x-y=0 does not pass through (2,1) because when you substitute it in, 3*2-1=0 is not true. Now I see a - after the y and I'm thinking that you may have left out a number. So I'll use the line 3x-y-5=0. This way at least the point is on the line.
So, f''(x)= 6x-6. Taking the antiderivative you get f'(x) = 6x^2/2 -6x + c, or f'(x) = 3x^2-6x + c. we need to find c. One use og the derivative is to find the slope of the tangent line at any given point. So, your line, or more accurately my line 3x-y-5=0 can be solved for y and becomes y=3x-5 and this has a slope of 3. So, at (2,1), or when x=2, your derivative must be 3. Let's plug it in.
f'(2)=3 must be true.3(2)^2-6(2)+c = 3. 12-12+c=3, therefore c=3. My first derivative is now complete, f'(x) = 3x^2-6x+3.
Now another antiderivative to get f(x)= 3x^3/3 - 6x^2/2 +3x +d or f(x) = x^3 -3x^2 +3x + d. How do we find d?
Another way of writing (2,1) is by saying f(2)=1. That's how you get points to plot to make a graph....plug 2 into the function and you get the corresponding y value which in this case is 1. So, let's plug in. f(2)=(2)^3-3(2)^2+3(2)+d=1. 8-12+6+d=1, 2+d=1 and d=-1. So, f(x) = x^3-3x^2+3x-1 is your answer.
You can check by taking the first and second derivative, make sur f(2)=1, f'(2)=3, and the second derivative is what you started with in the original problem.
Hope this helps!!!
Tilda W.
08/11/14