I should note that this result applies for x>0. The sign changes for x<0.
thank you very much alan for aswering my question(im sorry i didnt notice you had another approach on the 1st problem and yeah that is the right one) , but i got confused on how you wrote the second problem is y= squaroot of 1+ tan^2 (theta) , is it just equal to your y= squaroot of 1+ tan (theta) ^2?