# How to evaluate Integrate[Exp[Csch[(x - τ)]^2], {x, 0, x}]

I have been trying to integrate the following and Mathematica couldn't integrate it. Can someone help me on this?

Assuming[{Element[{x, τ}, Reals], x > 0, τ > 0, (x - τ) != 0},
Integrate[Exp[Csch[(x - τ)]^2], {x, 0, x}]]

• What does it mean that you want to integrate the variable x from 0 to x? – bill s Nov 30 '19 at 0:53
• Your question makes no sense. If $\tau >0$ and the integral goes from $x=0$, then there will always be a value where $x=\tau$. – David G. Stork Nov 30 '19 at 1:37
• I assume you mean, Assuming[{Element[{x, τ}, Reals], x > 0, τ > 0, (x - τ) != 0}, Integrate[Exp[Csch[(x - τ)]^2], {τ, 0, x}]]. The integral is infinite. – bbgodfrey Nov 30 '19 at 3:58
• ParametricNDSolve[] is usable for this. – J. M.'s technical difficulties Nov 30 '19 at 6:15
• @J.M.willbebacksoon. I think my answer implements something similar to what ParametricNDSolve would do. – m_goldberg Nov 30 '19 at 6:27

The integral doesn't seem to have any closed form solution. You can get an approximation to it by building an interpolating function and integrating it. Like so:

Clear[f, pts, ff, int]
f[τ_][u_] := Exp[Csch[(u - τ)]^2];
ff[τ_, x_, dx_] := Interpolation[Table[{u, f[τ][u]}, {u, 0, x, dx}]];
int[x_, dx_][τ_] := Function[u, Integrate[ff[τ, x, dx][uu], {uu, 0, u}]]


Then, given τ = 2, x = 1.25, dx = .001, we can use int[x, dx][τ] as function that behaves like the function that is the integral of f. For example:

With[{τ = 2, x = 1.25, dx = .001},
Plot[{f[τ][u], int[x, dx][τ][u]}, {u, 0, x}, PlotLegends -> "Expressions"]]


• Thank you @m_goldberg. Can you also look at (mathematica.stackexchange.com/questions/210534/…) and give me an input? Appreciate it. – Kobe Nov 30 '19 at 23:12
• @Sankalpa. That is a much more difficult integral to deal with. The techniques I used here might help, but using them would require a lot of non-trivial effort. I don't have the spare time to make such an effort. – m_goldberg Nov 30 '19 at 23:36
• I totally understand. Thank you for sharing this solution with me. Appreciate it. – Kobe Dec 1 '19 at 4:21

As suggested by @JM, you can use ParametricNDSolveValue to obtain a numerical approximation to your integral:

pf = ParametricNDSolveValue[
{
int'[u] == Exp[Csch[u-τ]^2],
int[0] == 0
},
int,
{u, 0, τ-.1}, (* avoid singularity at τ *)
τ
];


Visualization (using @m_goldbergs settings):

Plot[{Exp[Csch[x-2]^2], pf[2][x]}, {x, 0, 1.25}]


• Thank you @Carl Woll – Kobe Nov 30 '19 at 23:09