Skip to content

The other two Pythagorean identities are not known #725

Description

@Rafael-SOWNet

sin(x)^2 + cos(x)^2 simplifies to 1. Neither of the other two forms of the same identity does, in either direction:

1 + cotan(t)^2 - 1/sin(t)^2   =>  1 + cotan(t) ^ 2 - 1 / sin(t) ^ 2     should be 0
1 + tan(t)^2   - 1/cos(t)^2   =>  1 + tan(t) ^ 2 - 1 / cos(t) ^ 2       should be 0
csc(t)^2 - cotan(t)^2         =>  csc(t) ^ 2 - cotan(t) ^ 2             should be 1
sec(t)^2 - tan(t)^2           =>  sec(t) ^ 2 - tan(t) ^ 2               should be 1
1 + cotan(t)^2                =>  unchanged                             should be csc(t) ^ 2
1 + tan(t)^2                  =>  unchanged                             should be sec(t) ^ 2

Patterns.TrigonometricRules carries sin^2 + cos^2 in both orders and nothing for the other two. They are the same identity divided through by sin^2 and by cos^2, so a library that knows one and not the others is inconsistent about which way an expression happens to have been written.

Where it bites

This is the last thing standing between Simplify and 0 on the second expression in #557. That one reduces as far as

1 / sin(t) ^ 2 - (1 + cotan(t) ^ 2)

and stops — a difference of two equal things, left in two different notations. Everything else the reporter's expression needs is already there: the multiple-angle expansion opens sin(2t), and the rational cancellation over sin/cos works ((2*cos(t)^2*sin(t)^6 - cos(t)^2*sin(t)^6 - sin(t)^6*(cos(t)^2 - sin(t)^2))/sin(t)^8 gives 1).

So #557's first expression is already answered on master --

(sin(2t)*csc(t))^2/4 - cos(2t) - sin(t)^2   =>   0 provided not sin(t) = 0

-- and the second is not, and this is the whole of the difference.

What it needs

Two rules, and a normal form to compare against. The identities themselves are one line each; what they also need is for 1/sin(x)^2 and csc(x)^2 to reach a common form, since it is the mismatch between those two spellings that leaves the difference standing. CollapseTrigonometricFunctions already rewrites a / sin(x) to a * csc(x) but does not see through a power.

Measured against master at 7a38a8a.

Activity

  1. Rafael-SOWNet commented on Aug 5, 2026

    @Rafael-SOWNet
    MemberAuthor

    #726 fixes the arrangements that are adjacent in the tree, which is all six listed above plus the two solved-for-one-square forms found while doing it:

    1 - sin(t)^2            =>  cos(t)^2
    1 - cos(t)^2            =>  sin(t)^2
    1 - sin(t)^2 - cos(t)^2 =>  0
    1 + tan(t)^2            =>  sec(t)^2
    1 + cotan(t)^2          =>  csc(t)^2
    sec(t)^2 - tan(t)^2     =>  1 provided not cos(t) = 0
    csc(t)^2 - cotan(t)^2   =>  1 provided not sin(t) = 0
    

    Correcting the diagnosis above

    The report guessed that 1/sin(x)^2 and csc(x)^2 fail to reach a common form. That was wrong — they do:

    csc(t)^2 - 1/sin(t)^2   =>  0 provided not sin(t) = 0
    

    The actual cause is adjacency. Every rule here matches a pattern, so the two parts of the identity have to be neighbours in the tree, and in a sum of three terms the sorting separates them before the rules are tried:

    1 + cotan(t)^2               =>  csc(t)^2      reduces
    csc(t)^2 - 1/sin(t)^2        =>  0             reduces
    1 + cotan(t)^2 - 1/sin(t)^2  =>  unchanged     does not
    

    The same three terms written in sines and cosines do reduce (1 + cos(t)^2/sin(t)^2 - 1/sin(t)^2 is 0), so this is not the mathematics being out of reach — it is that the rule fires before the terms are gathered, and by the time they are gathered there is no rule.

    There is an asymmetry inside that too, worth recording: 1 + sin(t)^2/cos(t)^2 - 1/cos(t)^2 stops at 1 - 1/cos(t)^2 + tan(t)^2, collapsing its quotient back to a tangent, where the sine half of the same pair reduces.

    What is left

    Stating the identity over the gathered terms of a sum rather than over an adjacent pair. That is a larger change than the eight rules in #726 and is left for its own piece of work; it is also the last thing between #557's second expression and 0. Pinned in PythagoreanIdentityTest.TheThirdTermOfTheIdentityHasToBeAdjacent as a skipped theory carrying the diagnosis, beside a passing one showing the sin/cos spellings that do reduce.

    Leaving this open until that lands.

  2. added theissue type on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions