Solve a triangle using the law of cosines from two sides and the included angle, or from three known sides, with every substitution shown.
You are a careful trigonometry tutor who never lets a negative cosine value throw off an angle calculation, because arccos of a negative number correctly returns an obtuse angle, and treating that result as a mistake instead of a valid obtuse triangle is a common way this problem goes wrong. Work in [MODE:select:solve for a missing side given two sides and the included angle,solve for a missing angle given three sides,explain with a worked example] mode. If I chose the first, my two known sides are [SIDE_A?] and [SIDE_B?], and the angle between them is [ANGLE_C?]. If I chose the second, my three sides are [SIDE_A?], [SIDE_B?], and [SIDE_C?]. Before calculating anything with three sides, check the triangle inequality: the sum of any two sides has to be greater than the third side. If that check fails, say so directly and explain that no such triangle can exist instead of forcing a calculation through invalid numbers. If I chose solve for a missing side, this is the SAS case, and the included angle has to sit directly between the two given sides for this formula to apply, not opposite either one. Write c² = a² + b² − 2ab·cos(C) with my values substituted in. Square each of the two known sides as separate steps, add those together, then calculate 2ab·cos(C) as its own step, and subtract that from the sum last. Take the square root of the result for the final side length. State the answer, then verify by confirming this new side is shorter than the sum of the other two sides and longer than their difference, which any valid triangle must satisfy. If I chose solve for a missing angle, this is the SSS case. Pick which angle to solve for and rearrange the formula to isolate its cosine, for example cos(C) = (a² + b² − c²) / (2ab) when solving for the angle opposite side c. Square each side as its own step, combine them in the numerator, calculate the denominator separately, and divide last to get the cosine value before taking the inverse cosine. If that cosine value comes out negative, say so plainly and confirm the angle is obtuse, greater than 90 degrees, rather than treating the negative sign as an error. State the final angle, then verify by confirming all three angles of the triangle, once you've solved for the rest using the law of sines or by repeating this process, sum to exactly 180 degrees. If I chose explain with a worked example, use my values as the example if they're real numbers that pass the triangle inequality, or fall back to sides of 8 and 10 with an included angle of 60 degrees if I left them blank, and say plainly which one you picked. Explain in one plain sentence that the law of cosines is really the Pythagorean theorem with a correction term added in, since setting the angle to exactly 90 degrees makes cos(C) equal zero and collapses the formula back down to c² = a² + b², the ordinary Pythagorean relationship. Then solve the example using the identical step-by-step and verification discipline described above, so the explanation and the worked proof of it match. If I only give you two sides and an angle that is not between them, say so plainly, since that's an SSA setup for the law of sines instead, not a valid case for the law of cosines, and this formula will not solve it correctly.
Use this prompt anywhere
10,000+ expert prompts for ChatGPT, Claude, Gemini, and wherever you use AI.
Get Early AccessThe law of cosines handles two situations the law of sines can't reach directly, SAS, two sides with the angle squeezed between them, and SSS, three sides and no angle at all. This tool takes your [SIDE_A], [SIDE_B], and either [ANGLE_C] or a third side, and solves either direction with the substitution shown as separate visible steps instead of one dense calculation.
A negative value under the inverse cosine step trips people up in the SSS case, since it looks like an error but just signals a valid obtuse angle instead. This tool states that plainly instead of treating a negative cosine as a mistake to fix. And before working through SSS, it checks the triangle inequality to confirm the three given sides can form a real triangle in the first place.
Explain with a worked example connects the formula back to the Pythagorean theorem solver, showing that setting the angle to exactly 90 degrees collapses c² = a² + b² − 2ab·cos(C) down to the ordinary right-triangle formula, using a clean two-side, 60-degree example.
Run it in the Dock Editor to keep a running log of every triangle you solve, or pair it with the law of sines solver for the AAS, ASA, and SSA setups this formula can't handle on its own.
Whether you're in the Dock Editor or a chat assistant like ChatGPT, Claude, or Gemini, set [MODE] to solve for a missing side given two sides and the included angle, solve for a missing angle given three sides, or explain with a worked example.
Fill in [SIDE_A] and [SIDE_B] plus [ANGLE_C] for SAS, or all three sides for SSS.
For SSS input, the output confirms any two sides add up to more than the third before calculating anything.
Squaring, combining, and the final square root or inverse cosine are each shown on their own line.
If the cosine comes out negative, the output states plainly that this correctly signals an obtuse angle, not an error.
Paste your homework's known sides and angle into the matching mode and check each substitution step against your own worked answer.
Practice the SSS case specifically, where a negative cosine value signaling an obtuse angle trips up students who haven't seen it before.
Solve for an unknown distance or bearing when a field measurement gives two sides and the angle between them instead of a right angle.
Generate a model answer key that connects the law of cosines back to the Pythagorean theorem for students who haven't made that link yet.
Discover more prompts that could help with your workflow.
Calculate a term of an arithmetic sequence with the substitution shown, generate practice problems with an answer key, or explain the formula with an example.
Simplify an algebraic expression, check whether two expressions are truly equivalent, or generate practice problems spotting equivalent and non-equivalent pairs with an answer key.
Solve for a circle's area from a radius or diameter, showing the squaring step and verifying the result, or find a missing radius from area.
10,000+ expert-curated prompts for ChatGPT, Claude, Gemini, and wherever you use AI. Our extension helps any prompt deliver better results.