On this page
Some integrals look hard and then fall apart in two lines. A ratio like (a sin x + b cos x)/(c sin x + d cos x) is one of them. You don't need a tan(x/2) substitution, just one idea: split the numerator into a piece that cancels with the denominator and a piece that is the denominator's derivative.
The NCERT Class 12 chapter on integrals uses this idea in Example 6(iii), ∫dx/(1 + tan x), and Exercise 7.2 question 24 is another case of it (NCERT Mathematics Part II, Chapter 7).
Why does the numerator split work?
Call the denominator D = c sin x + d cos x. Its derivative is D′ = c cos x − d sin x, which is also a mix of sin x and cos x. So you can always write:
a sin x + b cos x = A·D + B·D′
Now divide by D:
A·D/D = A, which integrates to Ax
B·D′/D integrates to B ln|D|, because the integral of f′(x)/f(x) is ln|f(x)|
If that last rule feels shaky, see our post on why the integral of tan x is log sec x, which uses the same rule.
How do you find A and B?
Expand and collect terms:
A(c sin x + d cos x) + B(c cos x − d sin x) = (Ac − Bd) sin x + (Ad + Bc) cos x
Match this with a sin x + b cos x:
sin x terms: Ac − Bd = a
cos x terms: Ad + Bc = b
That gives two simultaneous equations in two unknowns.
Worked example: (3 sin x + 2 cos x)/(2 sin x + 3 cos x)
Here a = 3, b = 2, c = 2, d = 3.
D = 2 sin x + 3 cos x, so D′ = 2 cos x − 3 sin x.
Match sin x: 2A − 3B = 3.
Match cos x: 3A + 2B = 2.
Multiply the first by 2 and the second by 3, then add: 13A = 12, so A = 12/13.
Substitute back: 2B = 2 − 36/13 = −10/13, so B = −5/13.
Answer: (12/13)x − (5/13) ln|2 sin x + 3 cos x| + C.
To check, differentiate: over a common denominator, the numerator becomes (39 sin x + 26 cos x)/13 = 3 sin x + 2 cos x.
Now try the method on NCERT's example. Multiply top and bottom by cos x, and ∫dx/(1 + tan x) becomes ∫cos x/(cos x + sin x) dx. With a = 0, b = 1, c = 1, d = 1 you get A = B = ½. That gives x/2 + ½ ln|cos x + sin x| + C, which is the textbook's answer (NCERT Chapter 7, Example 6). It is also the standard table entry for ∫cos kx/(cos kx + sin kx) dx with k = 1 (List of integrals of trigonometric functions). NCERT writes log for the natural logarithm.
Is there a shortcut formula for A and B?
Solving the equations in general gives:
A = (ac + bd)/(c² + d²)
B = (bc − ad)/(c² + d²)
Here's the picture. Write each expression as its (sin x, cos x) coefficients. D is (c, d) and D′ is (−d, c), which is D turned through a right angle. A measures how much of the numerator points along D, and B how much points across it.
In board exams show the coefficient matching, and use the formula only as a check. For NCERT's question 24 it gives A = 0 and B = ½, so the answer is just ½ ln|6 cos x + 4 sin x| + C.
What mistakes cost marks on this integral?
Wrong sign in D′. The derivative of cos x is −sin x. Get this sign wrong and both A and B come out wrong.
Mixed-up columns. Line up sin x terms and cos x terms before you match them.
Dropping the modulus. Write ln|D|, because D can be negative.
Forcing the method. This split is built for a numerator and denominator that are both first-degree in sin x and cos x. A denominator like 3 + 2 sin x, or a squared one, needs other tools.
Rewriting a numerator so the fraction falls apart is also behind the add and subtract trick for x² over x² + 1 and the angle-shift trick for 1/(sin(x − a) sin(x − b)).
If you get stuck on the coefficient matching, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. If the f′/f rule is the gap, start with its lesson in the Fermi Concept Library.



