I have a mathematical function where both input parameters x
and y
are real numbers within the interval [−π,π]:
F[x_, y_] := (16 Sin[2*x]^2 Sin[y/2]^2)/(3 + Cos[4*x] - 2 Cos[y] Sin[2*x]^2)
I performed the integration of F with respect to y, aiming to obtain an expression dependent on x:
$Assumptions = {x \[Element] Reals, y \[Element] Reals};
InterF = FullSimplify[Integrate[F[x, y], {y, -Pi, Pi}]]
This integration yields the following conditional expression:
If Abs[Tan[x]]!=1&&Abs[Cot[x]]!=1
16*Pi*Cos[x]^2 Abs[Tan[x]]>=1&&Abs[Cot[x]]<1
16*Pi*Sin[x]^2 True
However, evaluating InterF
at x=Pi/4
(ie., InterF/. {x -> Pi/4}
) results in Undefined
because the conditions in the resultant expression do not include this specific case where x=Pi/4
.
I attempted setting GenerateConditions -> False
, which did not resolve the issue.
Question:
What should be done when a specific condition - in this case, If Abs[Tan[x]]!=1&&Abs[Cot[x]]!=1
— isn’t met? How can I achieve a defined integral result for x = Pi/4, especially if the conditions don't cover this case?
Is it okay to just pick one of the conditional expressions? Since the function F[x_, y_]
and its integral could be quite complex (instead of the straightforward example here), I'm unsure if choosing arbitrarily is appropriate. Any guidance or advice would be greatly appreciated. Thank you in advance.
Notably:
F[x, y] /. {x -> Pi/4} // Simplify
gives 4
, which means the integral result will be 8*Pi
. However, I don't want to set the value of x before integrating, as this is just a simple example here and I need an expression in terms of x for later evaluations with different x values.
Limit[InterF, x -> Pi/4]
? $\endgroup$Assuming[ Reduce[ -Pi <= x <= Pi && (Abs[Tan[x]] == 1 || Abs[Cot[x]] == 1), x], FullSimplify[Integrate[ F[x, y], {y, -Pi, Pi}]]]
but I'm not sure I undersand your problem. $\endgroup$-8*Pi*Abs[Cos[2*x]] + 8*Pi
. $\endgroup$