Product-to-sum cosine calculator
The cosine product-to-sum calculator rewrites a product of two cosines as one half of the sum of two cosine terms.
Run — free
Enter angles A and B in degrees or radians, and it applies cos(A) cos(B) = 1/2[cos(A - B) + cos(A + B)]. The response shows the original expression, the transformed expression, the sum and difference angles, and matching numerical values for both forms. It is useful for checking algebra, preparing integrals, simplifying trigonometric expressions, and understanding exactly where each term in the identity comes from.
Enter the two cosine angles
Start with an expression that is exactly a product of two cosine factors, such as cos(60°) cos(30°). Put the first angle in angle A and the second in angle B, then select degrees or radians for both. The calculator requires finite numeric angles because its purpose is to perform a precise transformation and return a checked value, not to guess how an unrestricted symbolic expression should be parsed. Negative angles and angles outside one revolution are valid; cosine is periodic, so there is no need to reduce them first. Keep both inputs in the same unit. For example, do not enter 60 as degrees and pi/6 as though it were a numeric radian value in the same request. If your source expression contains a coefficient outside the product, transform the cosine product here and multiply the entire returned right-hand side by that outside coefficient afterward. This keeps the identity application transparent and prevents a coefficient from being lost during manual work.
Read the product-to-sum transformation
The rule used is cos(A) cos(B) = 1/2[cos(A - B) + cos(A + B)]. The calculator first subtracts B from A for the difference angle, then adds A and B for the sum angle. It places those two angles into separate cosine terms and multiplies their sum by one half. Order matters only in the displayed difference: reversing A and B changes A - B to B - A, but cosine is even, so cos(B - A) equals cos(A - B) and the final value remains the same. The result includes a standard identity field as well as expressions with your actual numbers substituted. It also reports difference_angle and sum_angle separately, which makes it easier to audit signs before copying the expression into homework, a proof, or an integration step. Parentheses and the outer factor of one half are essential: the half multiplies the sum of both cosine terms, not merely the first term.
Verify the value and use the result
The original_value field evaluates cos(A) times cos(B) directly. The transformed_value field independently evaluates one half times the sum of cos(A - B) and cos(A + B). They should agree, apart from harmless floating-point rounding, because the transformation is an identity. Values are rounded to twelve decimal places so results such as a theoretical zero do not appear as tiny scientific-notation artifacts. The transformed form is especially useful when integrating products of trigonometric functions, because a sum of individual cosine terms is usually easier to integrate than a product. It also helps in Fourier analysis, signal calculations, and classroom exercises that ask you to rewrite rather than merely evaluate. Preserve the selected unit when using the combined angles elsewhere: the returned difference and sum are expressed in the same unit as the inputs. If you need an exact symbolic form involving pi, use the displayed identity as the algebraic template; this calculator intentionally evaluates finite numeric angles rather than accepting symbolic constants or variables.
What you can do with it
Prepare a trigonometric integral
Rewrite a cosine product as a sum before integrating each cosine term separately.
Check an identity exercise
Compare the substituted expression and both numerical values to catch sign or half-factor mistakes.
Analyze combined frequencies
Expose the difference-frequency and sum-frequency cosine components produced by two angles.
FAQ
What identity does the calculator use?
It uses cos(A) cos(B) = 1/2[cos(A - B) + cos(A + B)].
Can I use degrees and radians?
Yes. Select deg or rad, and use that same unit for both input angles.
Why are original_value and transformed_value both returned?
They evaluate the two forms independently, providing a numerical check that the transformation was applied correctly.
Does it accept variables or expressions containing pi?
No. Inputs must be finite numeric angles. The returned identity still provides the template for symbolic work.
What does the API request cost?
The API base price is $0.002 per request. The browser calculator is free to run on this page.
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/trig/product-to-sum-coscos \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"angle_a":60,"angle_b":30}'const res = await fetch("https://api.kit.forhosting.com/trig/product-to-sum-coscos", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"angle_a": 60,
"angle_b": 30
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/trig/product-to-sum-coscos",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"angle_a": 60,
"angle_b": 30
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/trig/product-to-sum-coscos", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"angle_a":60,"angle_b":30}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"angle_a":60,"angle_b":30}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/trig/product-to-sum-coscos", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"angle_a": 60,
"angle_b": 30
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "trig.product_to_sum_coscos",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |