I'm trying to solve the integral of (2**(1/2)*y**(1/2)/2)**2 from 0 to 5 (also shown here). I've been using
func = lambda y: ( 2**(1/2) * y**(1/2)/2 )**2 and a == 0 and b == 5
from scipy import integrate
integrate.quad(func, a b)
For some reason, I keep getting the value 1.25, while wolfram says it should be 6.25? I can't seem to put my finger on the error.
p.s. sorry for the error katrie, i forgot that python uses and not && for logical AND
SOLVED: this was a silly int/float error. thank you everyone.
1/2will evaluate to0. Also, your WolframAlpha link shows the answer for the integral ofy/2between 0 and 5.y/2, right? You're squaring a square root...andfor logical and,&is bitwise. But why is that in the function you're trying to integrate, anyway? I can't reproduce your bug, btw...integrateworks just fine for me.