ForHosting KIT · Math

Sum and difference identities

Expand the sine or cosine of a sum or difference of two angles in degrees: sin(30° + 45°) is worked out as sin 30 cos 45 plus cos 30 sin 45, giving 0.965925826289 for the combined 75°. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
A
30
B
45
Fn
Sin
Operation
Sum
You get
Value
0.9659258263
Combined angle
75
Identity
sin(a+b) = sin(a)cos(b) + cos(a)sin(b)

Sum and difference identities turn two separate angles into the sine or cosine of their combination without first adding the measures and then pressing a single trig key. Given two finite angles a and b in degrees, this tool expands the classical product forms: sine of a sum is sine a cosine b plus cosine a sine b, sine of a difference flips the mixed sign, cosine of a sum is cosine a cosine b minus sine a sine b, and cosine of a difference adds the mixed product.

How the sum and difference identities expand sine and cosine

Start with two real angles a and b expressed in degrees. Convert each measure to radians only so the floating-point sine and cosine routines can run, then evaluate sin a, cos a, sin b, and cos b once. The four classical identities are products of those four numbers rather than a single call on the already-combined measure.

Sine of a plus b equals sin a times cos b plus cos a times sin b. Sine of a minus b uses the same products with a minus on the mixed term: sin a cos b minus cos a sin b. Cosine of a plus b equals cos a times cos b minus sin a times sin b.

Cosine of a minus b flips that inner sign so the mixed product is added instead of subtracted. Those expansions are identities, not approximations: they hold for every real pair, including negative angles, reflex angles, and measures far outside a single turn of the circle. Using the product form is the point of a classroom check—the numeric result must match the expanded identity, not a different calculator path that hides the algebra behind one combined argument.

Because the implementation uses only finite-number validation, four trigonometric evaluations, and a handful of multiplies and adds, it is fully deterministic: the same pair, function, and operation always produce the same rounded value.

Where sum-difference identities show up in real work

Secondary-school and college trigonometry courses constantly ask students to expand sin of a plus b or cos of a minus b without a calculator, then check the numeric value against a table of exact special angles. Surveying and navigation combine heading offsets; audio and signal processing add phase angles; game engines and CAD pipelines rotate orientations by successive increments and still need the sine or cosine of the combined measure for a basis vector.

If you later need tangent of a combined angle, a double-angle expansion, a half-angle form, or a full right-triangle solver, treat those as separate search intents rather than overloading this identities landing. Keep requests small, pin the rounded value in tests, and you get a replayable oracle for homework, LMS plugins, and edge workers without standing up a computer-algebra system of your own.

Homework and exam identity checks

Expand sin(a±b) or cos(a±b) from two degree angles and verify the numeric value against known exact special-angle results.

Phase, heading, and rotation pipelines

Combine two orientation or phase angles and obtain the sine or cosine of the sum or difference for graphics, audio, or navigation code.

Which sum and difference identities does this evaluate?

The four classical product identities: sin(a+b)=sin a cos b+cos a sin b, sin(a−b)=sin a cos b−cos a sin b, cos(a+b)=cos a cos b−sin a sin b, and cos(a−b)=cos a cos b+sin a sin b. Choose fn and operation to pick one.

Are the input angles in degrees or radians?

Degrees only. Send a and b as finite degree measures. The implementation converts to radians internally for sine and cosine, then applies the identity products.

What happens if an angle is not finite?

Missing values, empty strings, NaN, and Infinity are rejected and are not billed.

What does the sum-difference identities tool cost?

The browser tool is free and runs locally.

Do the identities work for negative angles or angles over a full turn?

Yes. They are exact identities, not approximations, so they hold for every pair of real angles, including negative ones, reflex angles and measures well beyond a single turn of the circle.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/math/sum-difference-identities

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/math/sum-difference-identities \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a":30,"b":45,"fn":"sin","operation":"sum"}'
{
  "a": 30,
  "b": 45,
  "fn": "sin",
  "operation": "sum"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.sum_difference_identities",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Students checking homework, teachers writing keys, and engineers combining phase or heading offsets share one deterministic JSON contract that echoes both angles, names the identity that was applied, reports the combined measure, and returns the resulting value. Non-finite angles fail with invalid_input and are not billed. The free browser path and the API share one pure function, so a demo and a script never disagree.

What you send and what the identity evaluator returns

Send four fields. a and b are required finite numbers: the first and second angles in degrees. Both of those domains are closed enumerations so the form can offer a select instead of asking you to memorize a syntax. Non-numeric text, empty strings, NaN, and Infinity fail with invalid_input naming the field, and those failures are not charged. fn must be sin or cos; operation must be sum or difference. Aliases angle_a and alpha for a, angle_b and beta for b, function or trig for fn, and op for operation are accepted and mapped to the canonical names. On success the JSON echoes a, b, fn, and operation, reports combined_angle as a plus b or a minus b in degrees, names the identity string that was applied, and returns value as the evaluated sine or cosine, rounded to twelve decimal places so goldens stay stable across runtimes. A classic check: thirty degrees and forty-five degrees with fn sin and operation sum yield combined_angle seventy-five and a value about zero point nine six six, matching the exact radical (square root of six plus square root of two) over four. Sixty degrees and thirty degrees with fn cos and operation difference yield combined_angle thirty and a value about zero point eight six six, the familiar cosine of thirty degrees. Pair the response with your own display if you need a unit-circle sketch; this endpoint evaluates one chosen identity and does not emit plots or step-by-step prose beyond the identity field itself.

Where sum-difference identities show up in real work

A trusted endpoint with a strict finite-angle gate speeds grading and removes spreadsheet mistakes where someone typed degrees into a radian cell or subtracted the mixed product with the wrong sign. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Deterministic teaching fixtures

Generate stable sum-and-difference identity fixtures for unit tests and docs with the same pure function in the browser and the API.

Can I evaluate sine and cosine of both a+b and a−b in one call?

No. Each call evaluates one identity: pick fn (sin or cos) and operation (sum or difference). That keeps the landing focused on a single resulting value.

Read the full KIT documentation →