<s>[INST] Finding the value of $a$ and $b$ for the curve $y=ax^2+\frac{b}{x}$ given $\frac{dy}{dx}=-5$ at $(2,-2)$. The curve $y= ax^2 + \frac{b}{x} $ has a gradient of $-5$ at the point $(2,-2)$. Find the value of $a$ and $b$. 
These are my workings - 
 $$y= ax^2 + \frac{b}{x} \tag{1}$$ 
Sub $x=2 , y=-2$ 
$$8a+b=-4 \tag{2}$$
$$\frac{dy}{dx}\ = 2ax - bx^{-2} $$
When $x=2$ , $\frac{dy}{dx}\ = -5 $ 
$$-5 = 2ax - bx^{-2} \tag{3}$$
Here, I have two unknown constants $a$ and $b$. How should I find $1$ of the constant first? Or had I made a mistake earlier? Thanks !! 
 [/INST] You can easily obtain simultaneous equations from both $y$ and $\frac{dy}{dx}$. You are generally on the right track (You've found an equation using $y=ax^2+\frac{b}{x}$). However, for the derivative on equation $(3)$, you seem to have forgotten to substitute $x=2$. If you had substituted it, you would have gotten the simultaneous equations required. Below is the approach I would use:

Using the curve and substituting the known values at the point $(2,-2)$.
$$y=ax^2+\frac{b}{x} \implies -2=a\cdot 2^2+\frac{b}{2}$$
You evaluated your derivative correctly. Substituting the known values at the point $(2,-2)$ gives:
$$\frac{dy}{dx}=2ax-\frac{b}{x^2} \implies -5=2a\cdot 2-\frac{b}{2^2}$$
This gives you the system of equations:
$$\begin{cases} 4a+\frac{b}{2}=-2 \\ 4a-\frac{b}{4}=-5 \end{cases} \iff \begin{cases} 16a+2b=-8 \\ 16a-b=-20 \end{cases}$$

You can subtract one of the equations from the other to eliminate $a$. This gives:
$$16a+2b-(16a-b)=-8-(-20) \iff 2b+b=12$$
Can you solve for $b$, then find the corresponding value of $a$?
</s>