combine/arctan - Maple Programming Help

Home : Support : Online Help : Mathematics : Algebra : Expression Manipulation : Combining : combine/arctan

combine/arctan

combine arctangent terms

 Calling Sequence combine(f, arctan) combine(f, arctan, m)

Parameters

 f - any expression m - the name 'symbolic'

Description

 • The command combine(f, arctan) combines sums of arctangents in expressions by applying the following transformations:

$\mathrm{arctan}\left(x\right)+\mathrm{arctan}\left(y\right)=\left\{\begin{array}{cc}\frac{\mathrm{csgn}\left(\frac{{x}^{2}+1}{x}\right)\mathrm{\pi }}{2}& x=\frac{1}{y}\\ \mathrm{arctan}\left(\frac{x+y}{-xy+1}\right)& \left|xy\right|<1\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{csgn}\left(x\right)\ne \mathrm{csgn}\left(y\right)\\ \mathrm{arctan}\left(\frac{x+y}{-xy+1}\right)+\mathrm{csgn}\left(x\right)\mathrm{\pi }& \mathrm{otherwise}\end{array}\right\$

 If the input is a difference of two arctangents arctan(x) - arctan(y) then the above transformations are applied to arctan(x) + arctan(-y) .
 • If the conditions required for the transformations cannot be determined by Maple, then the arctangents are not combined.  If the optional argument symbolic is specified, and the conditions cannot be determined, then transformation $\mathrm{arctan}\left(x\right)+\mathrm{arctan}\left(y\right)=\mathrm{arctan}\left(\frac{x+y}{-xy+1}\right)$ is applied regardless.
 • Note, that in order to determine whether the transformations rules can be applied, one must be able to write an expression in the form
 $a+b\left(\mathrm{arctan}\left(c\right)±\mathrm{arctan}\left(d\right)\right)$ .
 This is not always easy to do so the code may fail to combine arctangent terms because of this.

Examples

 > $f≔\mathrm{arctan}\left(1-I\right)+\mathrm{arctan}\left(\frac{1}{2}+\frac{1}{2}I\right)$
 ${f}{≔}{\mathrm{arctan}}{}\left({1}{-}{I}\right){+}{\mathrm{arctan}}{}\left(\frac{{1}}{{2}}{+}\frac{{I}}{{2}}\right)$ (1)
 > $\mathrm{combine}\left(f,\mathrm{arctan}\right)$
 $\frac{{\mathrm{\pi }}}{{2}}$ (2)
 > $f≔\mathrm{arctan}\left(\frac{1}{3}\right)+\mathrm{arctan}\left(\frac{1}{5}\right)+\mathrm{arctan}\left(\frac{1}{7}\right)+\mathrm{arctan}\left(\frac{1}{8}\right)$
 ${f}{≔}{\mathrm{arctan}}{}\left(\frac{{1}}{{3}}\right){+}{\mathrm{arctan}}{}\left(\frac{{1}}{{5}}\right){+}{\mathrm{arctan}}{}\left(\frac{{1}}{{7}}\right){+}{\mathrm{arctan}}{}\left(\frac{{1}}{{8}}\right)$ (3)
 > $\mathrm{combine}\left(f,\mathrm{arctan}\right)$
 $\frac{{\mathrm{\pi }}}{{4}}$ (4)
 > $f≔\mathrm{arctan}\left(\frac{1}{3}\right)+\mathrm{arctan}\left(\frac{1}{4}\right)$
 ${f}{≔}{\mathrm{arctan}}{}\left(\frac{{1}}{{3}}\right){+}{\mathrm{arctan}}{}\left(\frac{{1}}{{4}}\right)$ (5)
 > $\mathrm{combine}\left(f,\mathrm{arctan}\right)$
 ${\mathrm{arctan}}{}\left(\frac{{7}}{{11}}\right)$ (6)
 > $f≔3\mathrm{arctan}\left(\frac{1}{3}\right)-2\mathrm{arctan}\left(\frac{1}{4}\right)+\mathrm{arctan}\left(\frac{1}{5}\right)$
 ${f}{≔}{3}{}{\mathrm{arctan}}{}\left(\frac{{1}}{{3}}\right){-}{2}{}{\mathrm{arctan}}{}\left(\frac{{1}}{{4}}\right){+}{\mathrm{arctan}}{}\left(\frac{{1}}{{5}}\right)$ (7)
 > $\mathrm{combine}\left(f,\mathrm{arctan}\right)$
 ${\mathrm{arctan}}{}\left(\frac{{427}}{{536}}\right)$ (8)
 > $f≔a\mathrm{arctan}\left(\frac{1}{3}\right)+a\mathrm{arctan}\left(\frac{1}{4}\right)+b\mathrm{arctan}\left(\frac{1}{5}\right)$
 ${f}{≔}{a}{}{\mathrm{arctan}}{}\left(\frac{{1}}{{3}}\right){+}{a}{}{\mathrm{arctan}}{}\left(\frac{{1}}{{4}}\right){+}{b}{}{\mathrm{arctan}}{}\left(\frac{{1}}{{5}}\right)$ (9)
 > $\mathrm{combine}\left(f,\mathrm{arctan}\right)$
 ${a}{}{\mathrm{arctan}}{}\left(\frac{{7}}{{11}}\right){+}{b}{}{\mathrm{arctan}}{}\left(\frac{{1}}{{5}}\right)$ (10)
 > $\mathrm{combine}\left(\mathrm{arctan}\left(x\right)+\mathrm{arctan}\left(\frac{1}{x}\right)\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{assuming}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}x::\mathrm{real}$
 $\frac{{\mathrm{signum}}{}\left({x}\right){}{\mathrm{\pi }}}{{2}}$ (11)
 > $f≔\mathrm{arctan}\left(x\right)+\mathrm{arctan}\left(y\right):$
 > $\mathrm{combine}\left(f\right)$
 ${\mathrm{arctan}}{}\left({x}\right){+}{\mathrm{arctan}}{}\left({y}\right)$ (12)
 > $\mathrm{combine}\left(f,\mathrm{arctan},\mathrm{symbolic}\right)$
 ${\mathrm{arctan}}{}\left(\frac{{x}{+}{y}}{{-}{x}{}{y}{+}{1}}\right)$ (13)
 > $\mathrm{assume}\left(0
 > $f=\mathrm{combine}\left(f,\mathrm{arctan}\right)$
 ${\mathrm{arctan}}{}\left({\mathrm{x~}}\right){+}{\mathrm{arctan}}{}\left({\mathrm{y~}}\right){=}{\mathrm{arctan}}{}\left(\frac{{\mathrm{x~}}{+}{\mathrm{y~}}}{{-}{\mathrm{x~}}{}{\mathrm{y~}}{+}{1}}\right){+}{\mathrm{\pi }}$ (14)
 > $\mathrm{assume}\left(x<0,0
 > $f=\mathrm{combine}\left(f,\mathrm{arctan}\right)$
 ${\mathrm{arctan}}{}\left({\mathrm{x~}}\right){+}{\mathrm{arctan}}{}\left({\mathrm{y~}}\right){=}{\mathrm{arctan}}{}\left(\frac{{\mathrm{x~}}{+}{\mathrm{y~}}}{{-}{\mathrm{x~}}{}{\mathrm{y~}}{+}{1}}\right)$ (15)