Questions tagged [special-functions]

Questions on the special mathematical functions implemented in Mathematica.

Filter by
Sorted by
Tagged with
45
votes
9answers
11k views

About multi-root search in Mathematica for transcendental equations

I have some questions for multiroot search for transcendental equations. Is there any clever solution to find all the roots for a transcendental equation in a specific range? Perhaps ...
19
votes
5answers
4k views

Numerical underflow for a scaled error function

I calculate a scaled error function defined as f[x_] := Erfc[x]*Exp[x^2] but it can not calculate f[30000.]. ...
7
votes
2answers
1k views

Why does Expand not work within a function?

I'm writing this fairly simple function: ...
57
votes
2answers
12k views

What is the difference between a few simplification techniques?

I am trying to understand the difference between Refine, Simplify and FullSimplify, and when ...
6
votes
3answers
421 views

Integrating a real function I get a complex value, while after variable transformation the result is real. Bug?

I have the following integral: Integrate[1/Sqrt[0.7 + 0.3*(1 + z)^3], {z, 0, ∞}, Assumptions -> z ∈ Reals] >> -3.36354 - 3.85013 I The output is complex, ...
5
votes
2answers
499 views

When does the real part of Zeta vanish on the critical line?

This seems to be a quite a simple problem but I cannot make it work. I am trying to find all values within a given range for which the real part of the Zeta ...
33
votes
1answer
700 views

Is MathieuC for moderately large imaginary arguments broken?

Bug introduced in 3.0 and persisting through 12.0 (reported as CASE:3208982) I'm trying to plot MathieuC[-3,0.3,I x] for $x\in[0,10]$, and here's what I get even ...
19
votes
2answers
1k views

Incorrect results for elementary integrals when using Integrate

There is a rather simple integral ($K_0$ is the 0-th order MacDonald function) $$\int_0^\infty e^{-x \cosh\xi}\, d\xi = K_0(x)$$ which mathematica cannot solve. This even though the documentation ...
6
votes
1answer
446 views

Precompiling a Whittaker function

Is there a way to speed up the evaluation of special functions in Mathematica? I am particularly interested in the Whittaker W function. For instance, the following piece of code: ...
10
votes
3answers
625 views

is it possible to change/customize some conversions done by TeXForm?

I use TeXForm to convert output of some computation to Latex. I'd like to ask if there is a way to override/change/customize some of these conversions, related to just the name Mathematica assigns to ...
9
votes
3answers
653 views

Labeling solutions of an Eigenvalue equation involving Bessel functions

I'm solving the Schrödinger equation for a particle in an annular geometry with hard wall boundary conditions and I've reduced it to the following equation: $$J_m(k\,R_1)\,Y_m(k\,R_2) - J_m(k\,R_2)\,...
8
votes
1answer
481 views

Possible bug in hypergeometric function AppellF1

In the context of sums over Legendre polynomials ((1), (2)) I stumbled upon the interesting hypergeometric function AppellF1[]. Unfortunately, the implementation ...
32
votes
2answers
4k views

Visualizing vector spherical harmonics

I have painstakingly derived the vector-spherical harmonics $\mathbf{V}_{J,\,M}^\ell(\theta, \phi)$, which are the generalization of ordinary spherical harmonics $Y_\ell^m(\theta, \phi)$ to vector ...
17
votes
2answers
820 views

What kind of hypergeometric function is it?

I found a formula for an integral of a product of three Bessel functions at The Wolfram Functions Site: I cannot understand what kind of hypergeometric function it is. The Mathematica code given for ...
10
votes
1answer
542 views

Mathematica implementation of Zeilberger's algorithm (previously done in Maple)

I have this Mathematica code: ...
16
votes
2answers
555 views

How can I get the solutions of $x^n-x-t=0$ in hypergeometric form?

$x^3-x-t=0$ has three roots that can be expressed in hypergeometric form, for example $$x_1=-1-\frac{t}{2}{_2F_1\left(\frac{1}{3},\frac{2}{3};\frac{3}{2};\frac{27t^2}{4} \right)}+\frac{3t^2}{8} {...
9
votes
3answers
2k views

Checking if the roots of a function are real

I'm trying to determine if the roots of a function are real. How would you do that? (In particular I'm interested in verifying that the roots of LegendreP[6, x] ...
4
votes
2answers
1k views

Replacing gamma at half integers by double factorial

It is well-known that for any positive integer $n$ the equality $\Gamma(n+\frac12)=\sqrt\pi\,(2n-1)!!/2^n$ holds, where $!!$ stands for the double factorial. I am using ...
5
votes
2answers
2k views

Solve stiff system by shooting method

I'm trying to solve a second order differential equation with the shooting method but, it appears to be a stiff system. This is worst for a larger parameter $\mu$. I've tried different methods: ...
11
votes
1answer
355 views

Fine tuning compiled code that computes dilogarithm function

As an exercise in writing a good Compile function, I want to do the simple task of coding a routine that outputs the real part of the dilogarithm function ...
27
votes
3answers
1k views

How to improve performance of BesselJ to the level of GSL?

Consider the following code: zs = N /@ Range[0, 12, 10^-5]; AbsoluteTiming[bessels = BesselJ[1, #] & /@ zs;] Length @ zs I've tried to measure only ...
10
votes
4answers
6k views

Plotting a Bifurcation diagram

I have the following system equation v'(t)=2*G*J1[v(t-τ)]cos(w*τ)-v(t) How do you plot the bifurcation diagram, τ in the x ...
2
votes
3answers
270 views

Why do these two different zetas produce the same value? [closed]

Zeta[-13] == Zeta[-1] == -1/12 Why do these two different zetas produce the same value?
3
votes
4answers
855 views

Hypergeometric function with a matrix argument

I am looking for the evaluation of a Hypergeometric function with a matrix argument as for example in Koev and Edelman or as showcased in this Wikipedia article. From what I understand from ...
37
votes
4answers
1k views

Is there a Mathematica API for the functions.wolfram site?

Is there a Mathematica API for the functions.wolfram site? If there's not, has anyone implemented a web scraper for it? For example it would be nice to be able to access http://functions.wolfram.com/...
20
votes
1answer
2k views

Eisenstein Series in Mathematica?

Mathematica doesn't seem to have built-in tools to deal with the Eisenstein series: $$\begin{align*} E_{2}(\tau)&= 1-24 \sum_{n=1}^{\infty} \frac{n e^{2 \pi i n \tau}}{1-e^{2 \pi i n \tau}}\\ E_{...
15
votes
2answers
3k views

Solve an integral equation numerically

I am trying to find a numerical solution for an equation of the form: $$ f(t) = \int_{t_{min}}^{t} \mathrm{d}t' {\exp[2 (t^\prime - t)] E(t^\prime) f(t^\prime)} + \int_{t}^{0}{\mathrm{d}t' \exp(t^\...
9
votes
2answers
690 views

How to simplify an expression with special functions to zero

The following is a well-known Bessel function identity: $$J_{-n}(z)=(-1)^n J_n(z),\qquad n\in\mathbb Z$$ To check this, I used the following code and the result is as what I expected. ...
8
votes
2answers
654 views

Analytical approximation of indefinite integral on a given interval to a given precision

I'm looking for an analytical approximation of $\int_a^b e^{-x^2}\mathrm{erf}(x+c) dx$ that would be accurate to precision $\varepsilon$ for $a,b,c$ within a certain range. How do I ask Mathematica ...
14
votes
4answers
896 views

Implementing a compilable Faddeeva function of complex argument

For those, who are looking at Halirutan's answer and thinking "gee, I wish I was that good at LibraryLink, then I could really speed up my code!" I leave here the ...
1
vote
3answers
664 views

Find all roots of a function with parabolic cylinder functions in a range of the variable

I want to find all roots of a function involving Parabolic Cylinder Functions. In what follows, I define 2 variables $\xi1$ and $\xi2$, which in turn depend on $\omega$. My function is then defined as ...
13
votes
2answers
985 views

Compiling the VoigtDistribution PDF

According to List of compilable functions, Erf and Erfc are compilable functions. However, I want to make a compiled version ...
11
votes
2answers
4k views

problem with coloring spherical harmonics

I want to color a spherical harmonics. So I write as follows. ...
8
votes
2answers
330 views

Taylor expansion of a function containing QPochhammer[q, q, n]

I want to get the following series expansion: Series[QPochhammer[q, q, 3], {q, 0,4}] but in Mathematica 11.0, I obtain the following gibberish: There weren't ...
7
votes
2answers
878 views

Approximation to the prime counting function

Is there a function similar to PrimePi that gives approximate value for large numbers? In particular, I need a reasonably good approximation for $\pi(x)$, where $x\...
3
votes
1answer
964 views

FindRoot giving false roots with Bessel Functions [duplicate]

I have read in some places about the errors associated with FindRoot, but the closest thing I can find on this website seems to be due to the imaginary unit. I am dealing with what should be a ...
2
votes
2answers
581 views

Solving Inequalities with Gamma Function

I am wondering why Mathematica outputs that the following system "cannot be solved with the methods available to Reduce". $\frac{\Gamma(\frac{1}{2}+n)}{n-1}<\frac{\Gamma(\frac{1}{2}+k)}{k-1}$ ...
14
votes
4answers
496 views

Terrible accuracy of DawsonF

DawsonF[30.] returns 0. The correct value is 0.016676... At least it prints a warning message, ...
12
votes
2answers
192 views

Why NIntegrate is badly-behaved on $J_{\frac{9}{2}}(x)$ by default?

A friend of mine showed me this example: Plot[BesselJ[9/2, x], {x, 0, 1}, PlotLabel -> Style["The integrand seems to be simple", 14]] ...
4
votes
2answers
750 views

Roots of Whittaker W function

I am interested in finding the roots $u$ of the equation $$ W_{1,\imath b}(a)=0, $$ where $W_{\kappa,\mu}(z)$ denotes the Whittaker $W$ function, $a>0$ is a fixed parameter, $\imath=\sqrt{-1}$ and $...
18
votes
1answer
4k views

Creating a Mathieu stability diagram

I am attempting to re-create a Mathieu stability diagram like the one shown here: I expected that I could use MathieuC to generate this graph by assuming that ...
8
votes
4answers
2k views

Visualizing the Riemann zeta function

How to visualize in a nice geometric way (e.g., like in this YT video) the Riemann zeta function, $\zeta (z)$?
18
votes
1answer
964 views

How to represent a continuous monotonic phase of Airy functions?

Note: In this question I am concerned only with real-valued variables and functions. DLMF, §9.8 Airy Functions, Modulus and Phase, formula $9.8.4$ defines the phase of Airy functions: $$\theta(x)=\...
11
votes
1answer
743 views

Expanding derivatives of hypergeometric functions

Sometimes Mathematica expresses results of integration or summation in terms of symbolic derivatives of Hypergeometric2F1 function, and cannot further simplify ...
13
votes
3answers
506 views

Find asymptotics of $\sum\limits_{i=0}^{n/3} 2^i \binom{n-i-1}{\frac{2n}{3}-1}$

I have an expression 2^n / Sum[ 2^i Binomial[ n - i - 1, 2n/3 - 1], { i, 0, n/3}] ...
9
votes
2answers
555 views

Number of divisors visualized with the QPochhammer function, how to improve performance of code?

I have this code that is originally Jeffrey Stopple's code for the Riemann zeta function in the complex plane. Because I discovered yesterday that the number of divisors can be generated with the $q$-...
16
votes
2answers
389 views

Backslide in NSolve in V11.1?

Bug introduced in 11.1.0 and persisting through 11.1.1 In V11.1, NSolve[BesselJ[0, x] == 0 && 0 < x < 20, x] returns no solutions: But in V11.0 (...
16
votes
1answer
642 views

How to enlarge Mathematica's knowledge about certain functions?

I'm often troubled with the following task. I need to carry out symbolical computations involving certain special functions. Let me take as an example Barnes gamma-function. It is included in ...
0
votes
3answers
356 views

Calculation of an integral with a Bessel function

How can I calculate below integral? Is it possible to calculate it in Mathematica? If yes, how? Am I doing something wrong? ...
21
votes
2answers
2k views

Why does Mathematica give the wrong answer when integrating?

Bug introduced in 8.0 or earlier and fixed in 9.0.0 I integrate Integrate[Exp[I Cos[b - c]] Cos[b], {b, 0, 2 Pi}] Mathematica gives: ...