0
$\begingroup$

Possibly a very amateur question, so I'll apologise in advance. I'm reasonably new.

I'm trying to write a Dot equivalent of ExpandDenominator, i.e something that will have the capacity to write something like:

DotExpDen[1/(a+b)^2] = a.a + 2a.b + b.b

When using ExpandDenominator/.Times->Dot, it will correct the second cross-term but retain a2 and b2.

I'm hoping to look at the internal workings of ExpandDenominator, and I'm sure this might be useful in the future for a variety of problems I'd encounter.

Is there a method to look at how Mathematica has implemented this in the back-end(?), like looking at a publicly available package? I could probably do it in a Module of some kind, but I'm just looking for a general technique and perhaps look at their method and definitions.

Thanks in advance.

$\endgroup$

marked as duplicate by Szabolcs, Lukas Lang, Community Nov 29 '18 at 15:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ ExpandDenominator is a kernel function that does not have a definition in the same sense as a function you write yourself. It is likely not implemented in the Wolfram Language internally. $\endgroup$ – Szabolcs Nov 29 '18 at 15:32
  • $\begingroup$ Thank you for that link. It's not quite what I'm after, but your comment has clarified my question. I guess it's not possible to read how Mathematica implements like this then? $\endgroup$ – Brad Nov 29 '18 at 15:35
  • 1
    $\begingroup$ Not for this function; for others: use the techniques in the duplicate. The source files for certain functions of specific areas can be found in various placed in the $InstallationDirectory, e.g. most of the parallel tools sources are readable. $\endgroup$ – Szabolcs Nov 29 '18 at 15:42
  • 1
    $\begingroup$ Specifically, I recommend this answer as a starting point: mathematica.stackexchange.com/a/78898/12 $\endgroup$ – Szabolcs Nov 29 '18 at 15:53
  • $\begingroup$ Thank you very much for your help Szabolcs. I appreciate your time! I have closed my question. $\endgroup$ – Brad Nov 29 '18 at 15:53