We have
#tan(x+pi/2)#
Let's solve a general case, which I think will come of great help.
Let us have #x# and #alpha#, and we wish to find
#tan(x+alpha)#
Remember that the tangent function is defined as the quotient of sine and cosine.
#tan(x+alpha)=sin(x+alpha)/cos(x+alpha)#
Now we can use the Sum formulas:
#sin(a+b)=sinacosb+cosasinb#
#cos(a+b)=cosacosb-sinasinb#
#=>color(red)( tan(x+alpha)=(sinxcosalpha+cosxsinalpha)/(cosxcosalpha-sinxsinalpha)#
This is the formula we are going to use. We could divide both the numerator and denominator by #cosxcosalpha# to get a tidier form
#tan(x+alpha)=(tanx+tanalpha)/(1-tanxtanalpha)#
However, in our case, #alpha=pi"/"2# and so #cosalpha=0#, meaning we would have to divide by zero, which is a no-no.
If we plug in #alpha=pi"/"2#, we have
#{(sinalpha=sin(pi/2)=1),(cosalpha=cos(pi/2)=0) :}#
#=> tan(x+alpha)=tan(x+pi/2)=(sinx*0+cosx*1)/(cosx*0-sinx*1)=-cosx/sinx=-cotx#