Advertisement
Guest User

Untitled

a guest
Aug 29th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. Clear[theta, x, y];
  2. f = 1/(x Cos[theta] + y Sin[theta])^(5/2);
  3. int = Integrate[f, theta];
  4.  
  5. int /. theta -> 2 Pi
  6.  
  7. int /. theta -> 0
  8.  
  9. (int /. theta -> 2 Pi) - (int /. theta -> 0)
  10. (* 0 *)
  11.  
  12. ClearAll[theta, x, y, f];
  13. f[{x_?NumericQ, y_?NumericQ}, theta_?NumericQ]:= 1/(x Cos[theta]^2+y Sin[theta])^(5/2);
  14.  
  15. pts = RandomReal[{0, 1}, {5, 2}];(*10 points*)
  16.  
  17. int = NIntegrate[Evaluate@f[#, theta], {theta, 0, 2 Pi}] & /@ pts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement