Find the dimensions(r and h) of the right circular cylinder of greatest Surface Area that can be inscribed in a sphere of radius R.

my work so far

I tried setting that equal to zero, but I wasn't coming up with the right answer

The answer in the book(not mine):

Can anyone see my error, or did I make one?