mathnet / mathnet-symbolics

Math.NET Symbolics
http://symbolics.mathdotnet.com
MIT License
341 stars 66 forks source link

Update differentiation of inverse trigonometric functions #42

Closed diluculo closed 6 years ago

diluculo commented 6 years ago

PR for #41

FoggyFinder commented 6 years ago

@cdrnet please, take a look at this

diluculo commented 6 years ago

In the meantime, I found another minor bug: cos(a) * sin(b) should be sin(a+b)/2 - sin(a-b)/2

FoggyFinder commented 6 years ago

@diluculo Where did you find this formula?

diluculo commented 6 years ago

@FoggyFinder Angle addition formulas say (1) sin(a+b) = sin(a)cos(b) + cos(a)sin(b) (2) sin(a-b) = sin(a)cos(b) - cos(a)sin(b) (1) - (2) gives sin(a+b) - sin(a-b) = 2cos(a)sin(b) So, we can get cos(a)sin(b)= (sin(a+b) - sin(a-b))/2

Please see this

FoggyFinder commented 6 years ago

@diluculo oh, right - it seems like I mixed it up with sin(x)*cos(y)

Do you want add some test?

diluculo commented 6 years ago

Some tests for Trigonometric.contract are added

cdrnet commented 6 years ago

Great, thanks a lot for the fix and the additional tests!