Key takeaways
- ∫sin(ax) dx = −cos(ax)/a + C.
- ∫cos(ax) dx = sin(ax)/a + C.
- Integrals divide by a; derivatives multiply by a.
- The #1 mistake is putting the minus sign on the wrong one. Check by differentiating.
In this guide
What is the integral of sin and cos?
Integration is differentiation run backwards. An indefinite integral (or antiderivative) of f is a function F whose derivative is f.
Since the derivative of sin x is cos x, the integral of cos x is sin x + C. Since the derivative of cos x is −sin x, the integral of sin x is −cos x + C.
Why do these integrals matter?
Waves are everywhere: sound, light, tides, alternating current. Integrating a wave gives totals, such as the position of a vibrating object from its velocity, or the area under one arch of a sine curve.
The area under one arch of y = sin x, from 0 to π, is exactly 2. Not π, not 1.5: exactly 2.
The formulas
| Symbol | What it means | Example |
|---|---|---|
| a | The number multiplying x (it cannot be 0) | 2 |
| x | The point where you evaluate, in radians | 0.7854 (π/4) |
| type | In the calculator: 1 = sin, 2 = cos | 2 |
| C | The constant of integration (the calculator uses C = 0) | 0 |
Why divide by a? Differentiating sin(ax) gives a·cos(ax), with an extra a from the chain rule. Dividing by a cancels it.
This calculator gives the value of the antiderivative at your x, taking C = 0.
How to integrate sin(ax) or cos(ax) step by step
- 1Find a. It is the number in front of x inside the sin or cos.
- 2Swap the function. sin becomes −cos; cos becomes sin.
- 3Divide by a. Keep the same inside, ax.
- 4Add + C. For an indefinite integral, always include it.
- 5Check by differentiating. You should get back what you started with.
Now try it yourself. Choose sin or cos, enter a and x in the calculator below, and see the value with every step.
Try it yourself
Pre-filled with the example — change any value.
Common mistakes to avoid
- Multiplying by a instead of dividing. Derivatives multiply by a; integrals divide by a.
- Forgetting + C on an indefinite integral.
- Using degrees. These formulas are for radians. Convert with the degrees to radians calculator.
Tips and tricks
- Fractions inside:
∫cos(x/2) dx = sin(x/2) ÷ (1/2) + C = 2sin(x/2) + C. - Numbers in front stay:
∫5cos x dx = 5sin x + C. - More complex insides: for things like
2x·sin(x²), use u-substitution.
Where you’ll use it in real life
- Physics: finding the position of a vibrating string or spring from its velocity.
- Electricity: average power and total charge in alternating current.
- Sound engineering: working with sound waves and signals.
- Geometry: areas under sine and cosine curves.
Quick summary
To integrate sin(ax), write −cos(ax)/a + C. To integrate cos(ax), write sin(ax)/a + C. Always divide by a, and check your answer by differentiating. Use the calculator above to find the value at any x (with C = 0), with every step shown.
Worked example
In a physics problem the velocity of a vibrating string is cos(2t), and you need its antiderivative (the position, with C = 0) at t = π/4 ≈ 0.7854 seconds. That is the cos type (type = 2) with a = 2 and x = 0.7854.
- 01∫cos(2x)dx = sin(2x)/2 + C
- 02At x = 0.7854: sin(1.5708) / 2
- 03sin(1.5708) = 1
- 04= 1 / 2 = 0.5 + C
These numbers are pre-filled in the calculator above.
Frequently asked questions
What is the integral of sin x?
It is −cos x + C. Check: the derivative of −cos x is sin x.
What is the integral of cos 2x?
It is sin(2x)/2 + C. Change cos to sin and divide by 2.
Why do we add + C?
Constants vanish when you differentiate, so −cos x, −cos x + 3 and −cos x − 10 all have derivative sin x. The + C covers all of them.
What is the integral of sin x from 0 to π?
It is 2. The antiderivative is −cos x, and (−cos π) − (−cos 0) = 1 + 1 = 2.


