I am trying to solve this question but encounter problem...
A curve has equation $x^2+y^2=r^2$. The point $P(a,b)$ is a point on the curve. Work out the equation of the tangent to the curve at $P$.
$$x^2+y^2=r^2\tag1$$ To find the coordinate of $P$ we sub into $(1)$
$$P(a,b)=P(\sqrt{r^2-a^2},\sqrt{r^2-b^2})$$
From the centre,O, to point $P$ is the coordinate $(\sqrt{r^2-a^2},\sqrt{r^2-b^2})$
So the gradient of the line $OP={\sqrt{r^2-b^2}\over \sqrt{r^2-a^2}}$
I am stuck at this point.
The coordinate of point $P(a,b)$ is just $(a,b)$.
The radius is perpendicular to the tangent.
Assuming $a \neq 0$ and $b \neq 0$, the gradient of the line connecting the origin to point $(a,b)$ is $\frac{b}{a}$, then the slope of the tangent would be $-\frac{b}{a}$.
Hence the gradient of the tangent is $-\frac{b}{a}$. So now I have told you the gradient of the tangent and you know it passes through $(a,b)$, can you find the equation of the tangent?
Also, can you see the solution if $a=0$? what about when $b=0$?
Remark about your attempt:
if point $(a,b)$ lies on the curve, then they satisfy $a^2+b^2=r^2$, and $a=\pm \sqrt{r^2-b^2}$.