Skip to content
    Calculus

    Integral of sin(ax) and cos(ax) Explained

    Is the integral of sin x equal to cos x or −cos x? Even strong students pause on this one. The integral of sin(ax) is −cos(ax)/a + C and of cos(ax) is sin(ax)/a + C. This guide shows where they come from and a 5-second check so you never mix up the sign again.

    Math Solver Academic Editorial Board4 min read

    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
    1. 01What is the integral of sin and cos?
    2. 02Why do these integrals matter?
    3. 03The formulas
    4. 04How to integrate sin(ax) or cos(ax) step by step
    5. 05Common mistakes to avoid
    6. 06Tips and tricks
    7. 07Where you’ll use it in real life
    8. 08Quick summary
    9. 09Worked example
    10. 10Frequently asked questions

    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

    ∫ sin(ax) dx = −cos(ax) ÷ a + C
    ∫ cos(ax) dx = sin(ax) ÷ a + C
    SymbolWhat it meansExample
    aThe number multiplying x (it cannot be 0)2
    xThe point where you evaluate, in radians0.7854 (π/4)
    typeIn the calculator: 1 = sin, 2 = cos2
    CThe 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

    1. 1Find a. It is the number in front of x inside the sin or cos.
    2. 2Swap the function. sin becomes −cos; cos becomes sin.
    3. 3Divide by a. Keep the same inside, ax.
    4. 4Add + C. For an indefinite integral, always include it.
    5. 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.

    🧮
    Calculus
    University

    Indefinite Integral of sin / cos

    Evaluate ∫sin(ax)dx or ∫cos(ax)dx. Choose type: 1 = sin, 2 = cos.

    ∫sin(ax)dx = −cos(ax)/a + C ; ∫cos(ax)dx = sin(ax)/a + C

    Area Under Curve ∫f(x)dx
    0.120
    120
    0.120

    💡 Example

    Reference
    Inputs:a=1, x=1.5708, type=1
    Result:0
    Open the full Indefinite Integral of sin / cos calculator

    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.

    1. 01∫cos(2x)dx = sin(2x)/2 + C
    2. 02At x = 0.7854: sin(1.5708) / 2
    3. 03sin(1.5708) = 1
    4. 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.

    #Calculus#University#Indefinite Integral of sin / cos
    Updated

    Keep reading

    Sponsored ToolsAd

    More tools on Ytools →
    Calcu.click — 25+ Free Smart Calculators preview

    Calcu.click — 25+ Free Smart Calculators

    Brand new calculation platform with 0ms reactive math, 100% client-side privacy, and dedicated subdomains. Fast calculators for EMI, SIP, Mortgage, Income Tax, BMI, Age, Percentage, and more.

    25+ CalculatorsFinanceHealth0ms Real-TimeFree
    Keyboard Arena preview

    Keyboard Arena

    Master touch typing with real-time WPM speed tests, mechanical switch audio, A-Z finger biomechanics drills, 40+ structured lessons, and competitive arcade games.

    Typing TestWPMTouch Typing
    Flutter Log Explorer preview

    Flutter Log Explorer

    Real-time structured log viewer and search explorer for Flutter & Dart. Zero-config capture from Debug Adapter (DAP) & Dart VM Service with smart classification and filters.

    FlutterDartVS Code ExtensionOpen VSX