--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/6fdc90f7-7013-4dc5-a96a-5a9db8b5a122n%40googlegroups.com.
Try adding this line immediately before your line 15:
print("p=",p," p_prime=",p_prime)
If you do that, you will see that p is a function - so it is OK to call it as in p(x),
however p_prime is an expression (an Add object, since it consists of a number of terms added/subtracted together), so it isn't OK to call it as in p_prime(x).
Hence your error message!
That error message is super obscure, it would be good to see it upgraded.
Cheers,
David