(%i1) f(r,phi) := signum(r^2 - 4); 2 (%o1) f(r, phi) := signum(r - 4) (%i2) integrate(integrate(r*f(r,phi), r, 0, 3), phi, 0, 2*%pi); (%o2) - 9 %pi
That's strange суббота, 9 апреля 2016 г., 19:14:49 UTC+3 пользователь Dima Pasechnik написал: > > Try these computations directly in Maxima, and see whether it's still a > discrepancy there. > > On Saturday, April 9, 2016 at 1:31:44 PM UTC+1, Sergey V Kozlukov wrote: >> >> x, y, r, phi = var('x y r phi') >> f(x, y) = sign(x^2 + y^2 - 4) >> T(r, phi) = [r*cos(phi), r*sin(phi)] >> J = diff(T).det().simplify_full() >> T_f = f.substitute(x=T[0], y=T[1]) >> int_f = integral(integral(T_f*abs(J), r, 0, 3), phi, 0, 2*pi). >> simplify_full() >> show(r"$\iint\limits_\Omega%s = %s$"%(latex(f(x)), latex(int_f))) >> Returns correct answer: $\pi$, while >> x, y, r, phi = var('x y r phi') >> f(x, y) = sign(x^2 + y^2 - 4) >> T(r, phi) = [r*cos(phi), r*sin(phi)] >> J = diff(T).det() #.simplify_full() >> T_f = f.substitute(x=T[0], y=T[1]) >> int_f = integral(integral(T_f*abs(J), r, 0, 3), phi, 0, 2*pi). >> simplify_full() >> show(r"$\iint\limits_\Omega%s = %s$"%(latex(f(x)), latex(int_f))) >> Yields $-9\pi$ >> The only thing simplify_full() changes here is it applies identity >> $\sin^2 + \cos^2 = 1$ >> >> Code was executed in SMC worksheet >> > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.