# Antiderivatve to find a function such the the slope is true for all points $(x,y)$

"The graph of a certain function $f$ has the slope $4x^3-5$ at each point $(x,y)$ and the line $x+y=0$ is the tangent line to the graph. Find the function $f$."

I took the antiderivative to get $f(x)=x^4-5x+C$ but I'm not really sure how to get the initial conditions. I have that $x+y=0$ or $y=-x$ so the slope is $-1$. I can then plug it into $-1=4x^3-5$ and solve for $x$ to get $x=1$.

I can then plug that x value into $y=-x$ to get $y=-1$. Since the tangent line and the graph must share the same common point then $(1,-1)$ must be on the graph of $f(x)$. So I can solve for the initial condition which means that $-1=1-5+C$ or $3=C$ so $f(x)=x^4-5x+3$ . Is the method correct?

Your method, and your result, are correct. You can verify this solving the system of the line and the quartic: $$\begin {cases} y=-x\\ y=x^4-4x+3 \end{cases}$$ this gives the equation $$-x=x^4-5x+3 \iff x^4-4x+3=0 \iff (x-1)^2(x^2+2x+3)=0$$
That has a double root at $x=1$, so the line is tangent to the curve at this point.