0
$\begingroup$

I have some analytical results from a physics problem, where the Mathematica gives the results in terms of complex error function. I would like to explore another function representation using Mathematica. Here it is the code for the function.

enter image description here

    U=(1/4+I/4)  1/k Sqrt[\[Pi]] /Sqrt[ k R]  E^(-((I k (R^2+L^2))/(2 R)))
    (-erfi((1/2+I/2) 1  /Sqrt[k  R]   
    (R-Sqrt[d^2+L^2]))-erfi((1/2+I/2) 1  /Sqrt[ k  R]     (Sqrt[d^2+L^2]+R))+erfi((1/2+I/2) 1  /Sqrt[k  R] (R-L))+erfi((1/2+I/2) 1  /Sqrt[ k  R] (R+L)))

For example for simplicity taking some values constants, let's say k = 1; R = 1; d = 1;. It is possible to approximate using series, finally the real part is needed to have physical meaning and interpretation.

$\endgroup$
1
  • $\begingroup$ Could you please elaborate why you need (or want) "another" representation instead? What is the purpose or form of such a representation? $\endgroup$
    – Syed
    Nov 24 '21 at 13:08
0
$\begingroup$

Mathematica functions start with a capital letter, function definitions need square brackets! Change erfi( ...) to Erfi[ ... ]

U = (1/4 + I/4) 1/k Sqrt[\[Pi]]/
   Sqrt[k R] E^(-((I k (R^2 + L^2))/(2 R)))
(-Erfi[(1/2 + I/2) 1/Sqrt[k R] (R - Sqrt[d^2 + L^2])] - 
  Erfi[(1/2 + I/2) 1/Sqrt[k R] (Sqrt[d^2 + L^2] + R)] + 
  Erfi[(1/2 + I/2) 1/Sqrt[k R] (R - L)] + 
  Erfi[(1/2 + I/2) 1/Sqrt[k R] (R + L)])

real part of U

ComplexExpand[Re[U]]:

(*
(Sqrt[\[Pi]] (k^2 R^2)^(3/4)
   Cos[(k (L^2 + R^2))/(2 R)] Cos[1/2 Arg[k R]])/(4 k^3 R^2) + (
 Sqrt[\[Pi]] (k^2 R^2)^(3/4)
   Cos[1/2 Arg[k R]] Sin[(k (L^2 + R^2))/(2 R)])/(4 k^3 R^2) + (
 Sqrt[\[Pi]] (k^2 R^2)^(3/4)
   Cos[(k (L^2 + R^2))/(2 R)] Sin[1/2 Arg[k R]])/(4 k^3 R^2) - (
 Sqrt[\[Pi]] (k^2 R^2)^(3/4)
   Sin[(k (L^2 + R^2))/(2 R)] Sin[1/2 Arg[k R]])/(4 k^3 R^2)

*)

$\endgroup$
1
  • $\begingroup$ Or ComplexExpand[Re[U], TargetFunctions -> {Re, Im}] // FullSimplify $\endgroup$
    – Bob Hanlon
    Nov 24 '21 at 14:33
0
$\begingroup$
Clear["Global`*"]

(altRep = Entity["MathematicalFunction", "Erfi"][
    "AlternativeRepresentations"]) // Column

enter image description here

(altRep2 = (#[z] & /@ altRep // Activate) /. 
    True -> Nothing) // Column

enter image description here

To make one into a replacement rule:

(#[[1]] /. z -> z_) -> #[[-1]] &@altRep2[[-2]]

(* Erfi[z_] -> (Sqrt[-z^2] (-1 + GammaRegularized[1/2, -z^2]))/z *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.