I have a function g
which is the result of another integrated function f
. This function (f
) has some singularities for some input values. While integrating function f
I want to tell NIntegrate
to take some value say p
at singularities.
f[x1_, x2_, t_, ra_] = Sin[x1]*ra +
ra*Cos[x2]*ArcTan[x1*ra + t*x2,
ra*t + x1*x2];
This function has singularities for ArcTan[0,0]
.
g[x1_, x2_, t_] :=
With[{ff = f[x1, x2, t, ra]},
NIntegrate[ff, {ra, 0, 10^(-3)},
Exclusions -> ArcTan[__, __] == 0]];
My actual code is about 300 lines long. The above problem might help me to solve my actual problem in Mathematica. Kindly anyone help me.
EDITED
Adding more information
I have function "f" inside this function I have many
h1[ArcTan[exp1, exp2]]
, h2[ArcTan[exp3, exp4]]
,....functions (may be more than 50 of ArcTan's are there). For some input values exp1
, exp2
, exp3
, exp4
, exp
... goes to 0. I applied
f /. ArcTan[0, 0] -> p
at the end of the function. I was thinking When I when I substitute the input values inside f1 it will have ArcTan[0,0]
and that gets replaced with "p".But it is not doing that. Is there a way to Replace ArcTan[0,0]
with "p" .Then this f1 function is called for another function g where it is integrated.