Skip to content

TrigToExp ​

Trigonometric and hyperbolic functions rewritten exactly in terms of the complex exponential.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageTrigToExp✓
TrigToExp(expr)Extends compute-engine's TrigToExp with the logarithmic closed forms for Arcsin, Arctan, Arcoth, and Arcsch when one of these is the top-level operator; everything else is left to the native rewriter.
SageMathSR(expr).exponentialize()
Typed signatures
TypePackageApplies
(value) -> valueanalyticreplaces compute-enginealways
(value) -> valuecompute-enginealways

Domain: Compute engine

Examples

Basic #

Cosine as the average of two complex exponentials

live ↗
InTrigToExp(cos⁡(x))\mathrm{TrigToExp}(\cos(x))Out12(eix+e−ix)\frac{1}{2}(e^{i x}+e^{-i x})

Hyperbolic sine as a difference of real exponentials

live ↗
InTrigToExp(sinh⁡(x))\mathrm{TrigToExp}(\sinh(x))Out12(ex−e−x)\frac{1}{2}(e^{x}-e^{-x})
Scope #

Tanh becomes a quotient of exponentials

live ↗
InTrigToExp(tanh⁡(x))\mathrm{TrigToExp}(\tanh(x))Outex−e−xex+e−x\frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}

Arcsine becomes a logarithm: −iln⁡(ix+1−x2)-i\ln(ix+\sqrt{1-x^2})

live ↗
InTrigToExp(arcsin⁡(x))\mathrm{TrigToExp}(\arcsin(x))Out−iln⁡(ix+1−x2)-i\ln(i x+\sqrt{1-x^2})

Inverse hyperbolic cotangent becomes a half-difference of logs

live ↗
InTrigToExp(arcoth(x))\mathrm{TrigToExp}(\mathrm{arcoth}(x))Out12ln⁡(x+1x−1)\frac{1}{2}\ln(\frac{x+1}{x-1})

Conversion reaches inside relations and conjunctions, leaving the arctan untouched

live ↗
InTrigToExp(sinh⁡(x)≤11∧arctan⁡(x)=7)\mathrm{TrigToExp}(\sinh(x)≤11∧\arctan(x)=7)Out12(ex−e−x)≤11∧arctan⁡(x)=7\frac{1}{2}(e^{x}-e^{-x})≤11∧\arctan(x)=7
live ↗
InTrigToExp([sin⁡(x),cos⁡(x),tan⁡(x)])\mathrm{TrigToExp}(\bigl\lbrack\sin(x), \cos(x), \tan(x)\bigr\rbrack)Out[(−12i)eix+12ie−ix,12(eix+e−ix),−i(eix−e−ix)eix+e−ix]\bigl\lbrack(-\frac{1}{2}i)e^{i x}+\frac{1}{2}ie^{-i x}, \frac{1}{2}(e^{i x}+e^{-i x}), \frac{-i(e^{i x}-e^{-i x})}{e^{i x}+e^{-i x}}\bigr\rbrack
live ↗
InTrigToExp(cos⁡(x)+isin⁡(x))\mathrm{TrigToExp}(\cos(x)+i\sin(x))Out12(eix+e−ix)+i((−12i)eix+12ie−ix)\frac{1}{2}(e^{i x}+e^{-i x})+i((-\frac{1}{2}i)e^{i x}+\frac{1}{2}ie^{-i x})
Applications #

Inner inverse trig stays inside the exponential

live ↗
InTrigToExp(sin⁡(5arcsin⁡(x)))\mathrm{TrigToExp}(\sin(5\arcsin(x)))Out(−12i)e5iarcsin⁡(x)+12ie−5iarcsin⁡(x)(-\frac{1}{2}i)e^{5i\arcsin(x)}+\frac{1}{2}ie^{-5i\arcsin(x)}
Properties #

Applies to every part of a chain of inequalities

live ↗
InTrigToExp(sin⁡(x)<x<tan⁡(x))\mathrm{TrigToExp}(\sin(x)\lt x\lt\tan(x))Out(−12i)eix+12ie−ix<x<−i(eix−e−ix)eix+e−ix(-\frac{1}{2}i)e^{i x}+\frac{1}{2}ie^{-i x}\lt x\lt\frac{-i(e^{i x}-e^{-i x})}{e^{i x}+e^{-i x}}

The right-hand side π/3\pi/3 is left as is

live ↗
InTrigToExp(sin⁡(x)=π3)\mathrm{TrigToExp}(\sin(x)=\frac{π}{3})Out(−12i)eix+12ie−ix=π3(-\frac{1}{2}i)e^{i x}+\frac{1}{2}ie^{-i x}=\frac{π}{3}
About
Examples11
Checked againstWolfram Language 11 agreeSageMath 8 agree1 unevaluatedSymPy 7 agree2 differ2 error
CrosswalkWolfram LanguageSageMath

Implementation

mappedwolframpackages/oracle/src/mappings.ts

identity rename (see names.wolframIdentity); kernel-verified on the Arcsin/Arccoth closed forms this override adds too.

mappedsagepackages/oracle/src/mappings.ts
mappedsympypackages/oracle/src/mappings.ts