def test_issue_6799():
    r, x, phi = map(Symbol, 'r x phi'.split())
    n = Symbol('n', integer=True, positive=True)

    integrand = (cos(n*(phi-x))*cos(n*x))
    limits = (x, -pi, pi)
    assert manualintegrate(integrand, x).has(Integral)
    assert r * integrate(integrand.expand(trig=True), limits) / pi == r * cos(n * phi)
    assert not integrate(integrand, limits).has(Dummy)
dataset/ETHPy150Open sympy/sympy/sympy/integrals/tests/test_manual.py/test_issue_6799/swapped operands of `-`