# Problem with SymPy

**URL:** <https://discourse.julialang.org/t/problem-with-sympy/94525>\
**Category:** General Usage\
**Created:** [February 12, 2023, 6:11pm UTC](https://discourse.julialang.org/t/problem-with-sympy/94525 "2023-02-12T18:11:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Firstname\_Lastname](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/firstname_lastname/32/34201_2.png) [@Firstname\_Lastname](https://discourse.julialang.org/u/Firstname_Lastname)\
**Post date:** [February 12, 2023, 6:11pm UTC](https://discourse.julialang.org/t/problem-with-sympy/94525/1 "2023-02-12T18:11:01Z")

</div>

I am having the following problem.

```julia
using SymPy
@syms x y
f = -integrate(sin(y)/(abs(y)-PI)^3,(y,x,PI/6)) + integrate(cos(y-x)/(abs(y)-PI)^3,(y,x,PI/6)) + integrate(sin(y)*cos(y-x)/(abs(y)-PI)^3,(y,x,PI/6)) - integrate(1/(abs(y)-PI)^3,(y,x,PI/6)) + integrate(sin(y)*cos(y-x)/(abs(y)-PI),(y,x,PI/6))
f(PI/8).evalf() # a numerical value appears: OK
f(0).evalf() # a numerical value appears: OK
f(-PI/8).evalf() # it takes so long, and finally outputs a numerical value: why soo long?

g = 125*500/9*PI^3*(-integrate(sin(y)/(abs(y)-PI)^3,(y,x,PI/6)) + integrate(cos(y-x)/(abs(y)-PI)^3,(y,x,PI/6)) + integrate(sin(y)*cos(y-x)/(abs(y)-PI)^3,(y,x,PI/6)) - integrate(1/(abs(y)-PI)^3,(y,x,PI/6))) + 25*PI/3*integrate(sin(y)*cos(y-x)/(abs(y)-PI),(y,x,PI/6))
g(-PI/8).evalf() # it takes sooo long, and still no output at all

```

If I conduct each integration separately, then there is no such behavior described above.

What is the reason for this problem? And how to resolve it (if not decomposing the function `f` or `g` into several parts, then evaluating each part before taking sum).

Thank you.
