mm-447 Subject: v.difficult (for me) 2D integration by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) id i0NDiW414044; I've been having trouble with the following difficult (for me anyway)finite 2D integration.Integrate f(x,y) = (x^2+y^2+2)/(sqrt((x^2+y^2)(x^2+y^2+4))) dx dy between x=-1 and 1, y=-1 and 1I need to do this over a square in x-y plane not a circle (theintegral can be evaluated analytically in polar coordinates over acircle in x-y but I haven't been able to do it over a square yet). Iknow the function diverges to infinity at x=y=0 but since anequivalent integration can be done in polar coordinates I figure itmust be doable in cartesians. Diverging to infinity at x=y=0 does notimply it can't be integrated.I tried mathematica but could not get it to produce a numerical result(it started giving me back random eliptical functions and things) so imaking sure it only evaluated f(x,y) very close (but not at) x=y=0.Iterations dividing the x-y area into ~15000^2 parts did not get theanswer to converge with any accuracy. NB - this program worked forsimpler integrals though took a suprising number of iterations to getaccurate.I am not looking for an analytical solution, only a numerical one (ifit exists!) so if anyone knows a way of doing this I'd be verygrateful for help!JamiePS. I actually have to do this integration over lots of diferentlimits of x & y so I would like to know the method as well as theanswer (if it exists) if possible === Subject: Re: v.difficult (for me) 2D integration .... Integrate f(x,y) = (x^2+y^2+2)/(sqrt((x^2+y^2)(x^2+y^2+4))) dx dy between x=-1 and 1, y=-1 and 1 .... I know you want the answer numerically rather than analytically, but FWIW it seems to be an elliptic integral. Changing to polar coordinates and chopping your square into eight triangles gives8*((integral from 0 to pi/4)d(theta))(integral from 0 to sec(theta))drof the integrand(r^2 + 2)/sqrt(r^2 + 4).The integral with respect to r needs only elementary functions, so the whole thing is4*(integral from 0 to pi/4)d(theta)of the integrand(sqrt(1 + 4(cos(theta))^2))/((cos(theta))^2).The substitution t = tan(theta) then gives4*(integral from 0 to 1)dtof the integrandsqrt((5 + t^2)/(1 + t^2))which is close to one of the standard forms of (complete?) elliptic integral. Perhaps someome more familiar with those can take it from there. === Subject: Re: v.difficult (for me) 2D integrationI've been having trouble with the following difficult (for me anyway)finite 2D integration.Integrate f(x,y) = (x^2+y^2+2)/(sqrt((x^2+y^2)(x^2+y^2+4))) dx dy between x=-1 and 1, y=-1 and 1Derive found the integral in the first quadrant to be about 2.028775634but it has built in checks when doing numerical integration and didwarn about dubious accuracy. Reducing the number of digits of precisionand asking it to repeat the calculations gave answers that were slightlysmaller, again with dubious accuracy warnings, but not wildly varying.So I think your answer is about 4x that value. === Subject: Re: v.difficult (for me) 2D integration>I've been having trouble with the following difficult (for me anyway)>finite 2D integration.>Integrate f(x,y) = (x^2+y^2+2)/(sqrt((x^2+y^2)(x^2+y^2+4))) dx dy> between x=-1 and 1, y=-1 and 1 Derive found the integral in the first quadrant to be about 2.028775634 but it has built in checks when doing numerical integration and did warn about dubious accuracy. Reducing the number of digits of precision and asking it to repeat the calculations gave answers that were slightly smaller, again with dubious accuracy warnings, but not wildly varying. So I think your answer is about 4x that value.I agree. So the answer seems to be about 8.115 .Mathematica can do one integration symbolically, giving a result in termsof incomplete elliptic integrals of both first and second kinds. But itcannot then integrate that result symbolically. Numerically integratingfrom y = a to y = 1, using values of a getting progressively closer to 0,and then doubling that result, I got the answer above. === Subject: Re: v.difficult (for me) 2D integration>Integrate f(x,y) = (x^2+y^2+2)/(sqrt((x^2+y^2)(x^2+y^2+4))) dx dy> between x=-1 and 1, y=-1 and 1> Derive found the integral in the first quadrant to be about 2.028775634>...> So I think your answer is about 4x that value.Mathematica can do one integration symbolically, giving a result in termsof incomplete elliptic integrals of both first and second kinds. But itcannot then integrate that result symbolically. Numerically integratingfrom y = a to y = 1, using values of a getting progressively closer to 0,and then doubling that result, I got the answer above.I don't know what eversion of MMA you are using or what you were givingMMA 5.0 seems happy with the following, without needing to choose 'a':NIntegrate[(x^2+y^2+2)/Sqrt[(x^2+y^2)(x^2+y^2+4)],{x,0,1}, {y,0,1}]2.02878 === Subject: Re: v.difficult (for me) 2D integration>>Integrate f(x,y) = (x^2+y^2+2)/(sqrt((x^2+y^2)(x^2+y^2+4))) dx dy>> between x=-1 and 1, y=-1 and 1> Derive found the integral in the first quadrant to be about>>2.028775634 ...>> So I think your answer is about 4x that value.>Mathematica can do one integration symbolically, giving a result in>terms of incomplete elliptic integrals of both first and second kinds.>But it cannot then integrate that result symbolically. Numerically>integrating from y = a to y = 1, using values of a getting progressively>closer to 0, and then doubling that result, I got the answer above. I don't know what eversion of MMA you are using or what you were giving MMA 5.0 seems happy with the following, without needing to choose 'a': NIntegrate[(x^2+y^2+2)/Sqrt[(x^2+y^2)(x^2+y^2+4)],{x,0,1},{y, 0,1}] 2.02878I had asked MMA 5.0 toNIntegrate[(-(1/Sqrt[4 + y^2]))*(2*I*((4 + y^2)*EllipticE[I*ArcCsch[y],y^2/(4 + y^2)] - 2*EllipticF[I*ArcCsch[y], y^2/(4 + y^2)])), {y, 0, 1}]and it did not seem happy with the singularity at y = 0. But I did not,as MMA suggested, Try using larger values for any of $MaxExtraPrecisionor the options WorkingPrecision, or SingularityDepth and MaxRecursion.Perhaps if I had done so, MMA would have been happy. === Subject: Gauss Method 2+4+6+8+...512 by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) id i0NG7F525693;My professor wants me to learn how to do the Gauss problemsIE:2+4+6+8+...+512 and 1+2+3+4+5+...+1000 using algebra not any kind === Subject: Re: Gauss Method 2+4+6+8+...512 My professor wants me to learn how to do the Gauss problems IE:2+4+6+8+...+512 and 1+2+3+4+5+...+1000 using algebra not any kindYou can write 1+2+3+...+1000 as 1+ 2+ 3+ ... + 500 +1000+999+998+ ... + 501 Now adding vertically first gives 500 copies of 1001 to be added.this is, more or less, what Gauss did. === Subject: Re: Gauss Method 2+4+6+8+...512 My professor wants me to learn how to do the Gauss problems IE:2+4+6+8+...+512 and 1+2+3+4+5+...+1000 using algebra not any kindReverse sequence2 + 4 + ... + 510 + 512512+510 +...+ 4 + 2add514+514 +...+ 514 + 514How may 514 are there? Call that number n.The total is 514n. Now divide by 2 for answer.Why is necessary to divide by 2? === Subject: Gauss Method by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) id i0O1ZU606812;The story goes that Karl Frederich Gauss, as a young boy, add up 1 + 2+ 3 + ... + 100by noting that the end-numbers have a sum of: 1 + 100 = 101then the next end-numbers have: 2 + 99 = 101and the next end-numbers have: 3 + 98 = 101 ... and so on.Since there are 50 such sums: 50 x 101 = 5,050 is the total.Your problems can be handled in a similar fashion.2 + 4 + 6 + 8 + ... + 508 + 510 + 512The end-sum is: 2 + 512 = 514And the next is: 4 + 510 = 514And the next is: 6 + 508 = 514 ... and so on.There are 128 such pairs to add up.The sum is: 128 x 514 = 65,792You should be able to the last problem yourself. === Subject: Gauss Method by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) id i0O4fRv19907;Thank you Thank you Thank you! === Subject: Tell me ...... by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) id i0O5IpT22077;Spare me qim. Why the hell is it wrong?? Just because some poxy bookhasn't got those angles in *their* answers??Don't you realise that when solving an equation, you can always checkyour answer(s) by substituting into the equation and checking that youget equality!? (Damn I should have shouted that). Try doing somethingintelligent like this next time qim. Had you done it here, you wouldhave immediately seen that your answersor tan A = 2 arctan = 63.4.bc1st = 63.4.bc and 3rd 180.bc + 63.4.bc = 243.4.bcare in fact correct.Good god man, why assume *you* are the wrong one if you get an answerdifferent to some poxy text book. Use a bit of common sense next time- check your answers fer cryin' out loud (as I suggested above).And have a bit of faith in *your* calculations. Looks to me like yourbook is developing quite a history for screwing up its answers (as innot including *all* solutions). === Subject: Challenging the algebra by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) id i0O61El25397;Funny you should mention that, for I've got a result here that I thinkwill allow me to prove that there is an inherent flaw in...ALGEBRA! I'm thinking about it... thinking... thinking....Yes! I'm right!! Proof to follow, but first, let's see if any of youcan prove it first... === Subject: Time better spent fishing by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) id i0OEswH28094;Give it up and move on! === Subject: exercise at algorithm analysis by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) id i0OKRuN18952;hi to allhow/were i can get exercise at algorithm analysis?thankssomebody === Subject: How much does Fred weigh by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision: 1.9 primary) id i0Q05C304899;Fred is a meat cutter who sells chicken breast for $3.88 per pound,ground beef for $2.75 per pound, and pork chops for $3.50 per pound. Fred wears size 36 jeans, is aobut five foot five, wears baggy shirtsand has size 12 shoes. What does Fred weigh? === Subject: Re: How much does Fred weigh Fred is a meat cutter who sells chicken breast for $3.88 per pound, ground beef for $2.75 per pound, and pork chops for $3.50 per pound. Fred wears size 36 jeans, is aobut five foot five, wears baggy shirts and has size 12 shoes. What does Fred weigh?And more importantly, what's a Henway? === Subject: Re: How much does Fred weigh> Fred is a meat cutter who sells chicken breast for $3.88 per pound,> ground beef for $2.75 per pound, and pork chops for $3.50 per pound. > Fred wears size 36 jeans, is aobut five foot five, wears baggy shirts> and has size 12 shoes. What does Fred weigh? And more importantly, what's a Henway?About 3 pounds. === Subject: Re: How much does Fred weigh Fred is a meat cutter who sells chicken breast for $3.88 per pound, ground beef for $2.75 per pound, and pork chops for $3.50 per pound. Fred wears size 36 jeans, is aobut five foot five, wears baggy shirts and has size 12 shoes. What does Fred weigh?Chicken, beef and pork? === Subject: regexI want to match mailto:null@void.com......gif in a string that contains manysimilar patterns.I used mailto:(.[^]*) to match each mailto: ... string and parsed outthe email address.But now I can't seem to extend the match to the first 'gif'.I have tried a number of different combinations but without the match Ineed.I know what I need. I need to do as I did in the example above except Ineed to not include a group of characters instead of just one. === Subject: Re: JSH: Algebra is supreme Adjunct Assistant Professor at the University of Montana....> Dedekind has shown that the algebraic integers form a gcd domain (actually> a bit more: it is a Bezout domain), so the gcd exists. It is quite> similar to the standard gcd in the integers, except that this definition> is not concerned with the sign, so in the integers, the gcd of 6 and 14> is +2 or -2.> Now a little theorem:> gcd(a * b, c) | gcd(a, c) * gcd(b, c).> You might try to prove it. The prove is easy in a unique factorisation> domain, less easy in other domains.This is true in any gcd domain. Don't know if it is true in apre-Schreier domain by itself, but here goes my proof for gcd-domain.(Seefor a table of implications; gcd implies pre-Schreier).In a pre-Schreier ring, any two factorizations of the same elementhave common refinements; and both gcd and pre-Schreier domain implyProp. If gcd(a,b)=1, then gcd(a,bc) = gcd(a,c).Proof. Let x = gcd(a,c), y = gcd(a,bc). Clealry x|y. Write a = yu, bc= yv. Then the factorizations bc=yv have a common refinement, so bc = yv = p*q*r*s, where b = pq, c = rs, y=pr, v=qs. Thusp|gcd(b,y). But if p|y then p|a, so p|gcd(b,y) = 1. Therefore, p is aunit. But that means that y=pr divides c=rs, so y|a, y|c, hencey|gcd(a,c)=x. Thus, x|y and y|x, giving that, up to units, they areequal. QED. Now back to the condition we have: we want to prove that gcd(ab,c)divides gcd(a,c)*gcd(b,c).Let r = gcd(a,c), s = gcd(b,c). We want to show that gcd(ab,c) dividesrs.Write a = ru, c = rv with gcd(u,v) = 1; b = sw c = sy with gcd(w,y) = 1.Using the pre-Schreier property, we can take the two factorizations ofc, rv = sy and find a common refinement, that is, writec = h*k*m*n, wherer = hk, v = mns = hm, y = kn.We haveab = (ru)(sw) = (hku)(hmw) = h^2*k*m*u*w. c = h*k*m*n.rs = h^2*k*m; and we see that the gcd of ab and c is h*k*m*gcd(huw,n).Since n|y and gcd(n,y) = 1, we have gcd(huw,n) = gcd(hu,n). Since n|vand gcd(u,v)=1, we have gcd(n,u)=1, so gcd(huw,n) =gcd(hu,n)=gcd(h,n). So gcd(ab,c) = h*k*m*gcd(h,n), which divides h*k*m*h = h^2*k*m = rs = gcd(a,c)*gcd(b,c).QED === Subject: Re: JSH: Algebra is supreme Adjunct Assistant Professor at the University of Montana....> Dedekind has shown that the algebraic integers form a gcd domain (actually> a bit more: it is a Bezout domain), so the gcd exists. It is quite> similar to the standard gcd in the integers, except that this definition> is not concerned with the sign, so in the integers, the gcd of 6 and 14> is +2 or -2.> Now a little theorem:> gcd(a * b, c) | gcd(a, c) * gcd(b, c).> You might try to prove it. The prove is easy in a unique factorisation> domain, less easy in other domains.This got me thinking and actually it is not always true in arbitrarygcd domains (I was too much working with the ideas I had rather thanreal proofs). It is, however, true in Bezout domains (which thealgebraic integers are).Proof: gcd(a, c) = p * a + q * c and gcd(b, c) = r * b + s * c for some p, q, r, s, by being Bezout. gcd(a, b) * gcd(b, c) = (p * r) * a * b + (p * a * s + r * b * q + q * s * c) * c, which is linear in a * b and c, and so is divisible by gcd(a * b, c).There are gcd-domains where the theorem is false: Q(sqrt(-5)) is one.Set a = 2, b = 3, c = 1 + sqrt(-5), we now have: gcd(a, c) * gcd(b, c) = 1 * 1 = 1, gcd(a * b, c) = c.Ehr, Q(sqrt(-5)) is a field, so everything divides everything. Iassume you meant Z[sqrt(-5)], but in that case, you are incorrect: itis not a gcd domain.Consider the numbers (1+sqrt(-5))*(4-sqrt(-5)) = 9+3*sqrt(-5) and (1+sqrt(-5))*(-1-2sqrt(-5)) = 9-3*sqrt(-5)I claim they do not have a gcd. A number that divides both must havenorm dividing both their norms. Since they are conjugates, both normsare equal, and equal to:N(9+3*sqrt(-5)) = N(3)*N(3+sqrt(-5)) = 3^2*(9+5)= 2*3^2*7Both are divisible by 3, so any gcd is a multiple of 3, hence has norma multiple of 3^2. They are also both divisible by 1+sqrt(-5), so agcd is a multiple of 1+sqrt(-5), hence of norm a multiple of 2*3(therefore, of norm a multiple of 2*3^2). So the only possibilitiesare norm 18 or norm 126.If a gcd had norm 126, then it would be an associate of both9+3*sqrt(-5) and of 9-3*sqrt(-5); so 9+3*sqrt(-5) and 9-3*sqrt(-5)would be associates. But this is false, since the only units here are1 and -1. So any gcd would necessarily have norm 18. So if a gcd is ofthe form a+b*sqrt(-5), a and b integers, then we have a^2 + 5b^2 =18. We may assume b is nonnegative. So 0<=b<=1; but b=0 implies a^2=18,impossible, and b=1 implies a^2=13, also impossible. Therefore, thereare no elements of norm 18, and in particular, 9+3*sqrt(-5) and9-3*sqrt(-5) do not have a gcd in Z[sqrt(-5)]. Therefore, Z[sqrt(-5)]is not a UFD.(In case you are wondering how I got the example: since the classnumber is 5, find five nonprincipal ideals P,Q,R,S,T and consider PQRSand PQRT. A gcd would be a multiple of the actual numbers whichgenerate PQ, PR, and QR, so its prime factorization would have to beof the form PQR*I; and I would have to be trivial by uniquefactorization into primes. But PQR is not principal. Having that as agoal, I just took the easiest examples I knew: I took the elements1+sqrt(-5), 1-sqrt(-5), and 7. Factoring as prime ideals, we have(1+sqrt(-5)) = PQ(1-sqrt(-5)) = PR (7) = STwith none of P,Q,R,S,T principal. QR=(3), and it was just a matter offinding out what RS and RT were.) === Subject: Re: JSH: Algebra is supreme Adjunct Assistant Professor at the University of Montana. [.snip.]Oops; sorry, a typo:(In case you are wondering how I got the example: since the classnumber is 5, find five nonprincipal ideals P,Q,R,S,T and consider PQRSand PQRT. That should be class number is 2, of course. Sorry... === Subject: recurrence relationmay you help me to solve the recurrence relation below? / | ( nabla^{k+1} f ) (Y_1, ...,Y_{k+1}) = | = Y_{k+1} (nabla^k f (Y_1, ...,Y_{k}) ) | - sum_{i=1}^k nabla^k f (Y_1, .,nabla_{Y_{k+1}}Y_i ,..,Y_k)/ | nabla^1 f (X)= df X | | Y_i denotes a tangent vector field over a differentiable manifold M,f is a real valued function over M, f: M--> R, nabla denotes a linear (affine) connession; nabla^{k+1} f := nabla (nabla^k f).Thank you very much ,