Trigonomic function question

Hey, I have been working a bit with the trig functions and came across this problem:

B = (A + sin(theta) )/ (sin(theta)*cos(theta))

when you separate the above fraction into the following:

C = A/(sin(theta)*cos(theta))

D = sin(theta) / (sin(theta)*cos(theta)) => 1/ cos(theta)

C+D != B if theta = 0 as sin(0) = 0 and cos(0) = 1

I came across this problem when trying to solve :

a - b*cos(theta) - b^2*sin(theta) = 0

Is there any method to make sure that this doesnt happen or do you just have to check the formula through for this?

Thanks for any replies.