Finding angles in a right angled triangle where one angle is 1/x or x^2

Working with a right angled triangle ABC with C as the right angle;

If A = x and B = x^2

What are the values of A and B?

Also,

If A = x and B = 1/x

What are the values of A and B?

Obviously

A + B + 90 = 180

So A + B = 90

So

x + x^2 = 90

and

x + 1/x = 90

The book I am working with has the answers in the back, so I know the answers, but I don't understand how the answers were arrived at.

I can work out x + 2x = 90

3x = 90

x = 90/3

x = 30

2x = 60

But I don't know the way to do the same with the reciprocal and the square:

x + 1/x = 90

1/x = 90 - x which cannot be right.