starting with #y+cosy=x+1#, you would differentiate

So #d/dx(y+cosy=x+1)#

#\implies y' - sin y \ y' =1#

#\implies y' =1/(1- sin y )# in terms of y!!

vertical tangents have slope #oo# which means tyically looking fo a demoninator of 0 in the fraction

so we are interested in #sin y = 1 #

#\implies y = pi/2, (5 pi) /2,..., (2k + 1/2)pi qquad qquad k in mathbf{Z}#

fortunately #cosy = cos (2k pi + pi/2) = cos 2k pi color(red)(cos (pi/2)) - color(red)( sin 2k pi ) sin pi/2#

and the terms in red are zero

#y+cosy=x+1# becomes

#(2k + 1/2)pi = x + 1#

# x = (2k + 1/2)pi -1#

that is generalised but #y in [0, 2 pi]# is specified. so we are limited to #k = 0#

that is to say # y = pi/2# when the vertical tangent is

#x = pi/2 -1#