6

I run this code:

Simplify[ArcTanh[x] + ArcTanh[y]]

and it keeps returning:

ArcTanh[x] + ArcTanh[y]

How do I direct it to simplify it that way ?

Panch93
  • 193
  • 5

5 Answers5

13

A little bit of trickery:

ArcTanh[x] + ArcTanh[y] // Tanh // TrigExpand // FullSimplify // ArcTanh

   (* ArcTanh[(x + y)/(1 + x y)] *)

Note the parentheses.

Michael Seifert
  • 15,208
  • 31
  • 68
J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
6

Probably, MathematicalFunctionData["ArcTanh"] knows about this.

First let's see what categories of things are known:

MathematicalFunctionData["ArcTanh", "Properties"]

ah well, let's just list them all (this will take a while to download the first time around)

all = DeleteDuplicates@Flatten[MathematicalFunctionData["ArcTanh", #] & /@ 
 MathematicalFunctionData["ArcTanh", "Properties"]];

now let's look whether that fact about ArcTanh[_] + ArcTanh[_] is in there

facts = Cases[all,
  Function[{_, _}, 
   e_ /; Not@FreeQ[e, Inactivate[ArcTanh[_] + ArcTanh[_]]]]
  ];

maybe some of these help. Let's Activate them.

activefacts = Through[facts[x, y]] // Activate  

drop some conditions

activefacts = Assuming[x \[Element] Reals && y \[Element] Reals, FullSimplify@activefacts];

Now

activefacts /. {x -> ..., y -> ...}

should be a list of True, Undefined or Indeterminate == ... for any real x and y.

(However, it seems to break here for exactly one of them being 1, the other not, activefacts /. {x -> 1, y -> 0.9} is {False, Undefined, False})


I think this is a method worth knowing in general.

For example, use

all = MathematicalFunctionData["Sinh", #] & /@ 
   MathematicalFunctionData["Sinh", "Properties"];
all = Flatten@all;
Cases[all,
 Function[{_, _}, e_ /; Not@FreeQ[e, Inactivate@Sinh[_ + _]]]
 ]

to learn everything MathematicalFunctionData knows about $\sinh(x + y)$.

masterxilo
  • 5,739
  • 17
  • 39
5

This is just not true for all (x,y):

(ArcTanh[x] + ArcTanh[y] - ArcTanh[x + y/(1 - x y)]) /. x -> 0.23 /.y -> .323

-0.0916564

or

(ArcTanh[x] + ArcTanh[y] - ArcTanh[(x + y)/(1 - x y)]) /.x -> 0.23 /. y -> .323

-0.11988

Solve[ArcTanh[x] + ArcTanh[y] == ArcTanh[x + y/(1 - x)], {x, y}]

{{x -> 0}, {y -> 0}, {y -> -1 - x + x^2}}

Feyre
  • 8,597
  • 2
  • 27
  • 46
kiara
  • 1,585
  • 8
  • 9
  • The formula originally used by the OP is wrong, but there is a similar one that is true. See my comment on the original question. – Michael Seifert Aug 18 '16 at 16:21
4

You should define a replacement rule somehow. You can store that rule in a variable and apply it locally.

rule = ArcTanh[x_] + ArcTanh[y_] :> ArcTanh[x + y/(1 - x)];

(* only first two terms are merged *)
ArcTanh[x] + ArcTanh[y] + ArcTanh[z] /. rule

ArcTanh[x + y/(1 - x)] + ArcTanh[z]

(* merging until rule no longer applies *)
ArcTanh[x] + ArcTanh[y] + ArcTanh[z] //. rule

ArcTanh[x + y/(1 - x) + z/(1 - x - y/(1 - x))]

Or you can associate the rule with ArcTanh directly. However, that is a System symbol and System symbols are (without exception I think) Protected, so do Unprotect first.

Unprotect[ArcTanh];
ArcTanh /: ArcTanh[x_] + ArcTanh[y_] := ArcTanh[x + y/(1 - x y)]
Protect[ArcTanh];

If you do this, ArcTanh behaves as desired and defined on its own, every time.

BoLe
  • 5,819
  • 15
  • 33
1

You can visit the documentation center of Mathematica for trigonometric expressions at this address tutorial/TrigonometricExpressions for more info.

In case you need its algebraic simplification you can use this code:

TrigToExp[ArcTanh[x] + ArcTanh[y]]

Which returns this as a result:

-(1/2) Log[1 - x] + 1/2 Log[1 + x] - 1/2 Log[1 - y] + 1/2 Log[1 + y]

Siav Josep
  • 557
  • 5
  • 19