## ParthKohli one year ago Interesting calc problem - please check my work.

1. ParthKohli

What is the average distance randomly selected in a unit equilateral triangle to its center? Here's what I think...

2. ParthKohli

So if we instead think of discrete points and try to think of the average distance, we'd think of something like this:$\sum \rm distance \cdot (fraction ~ of ~ points ~ that ~ are ~ that ~ distance ~ away)$

3. ParthKohli

|dw:1443350101709:dw|

4. ParthKohli

Here, the average distance turns out to be $$2\cdot 2/3 + 4\cdot 1/3 = 8/3$$ which makes sense.

5. ParthKohli

Now I tried to apply the exact same fact to a continuous system of particles like the interior of an equilateral triangle. But nope. Didn't work because we're gonna have to take radial elements and taking triangular elements wouldn't work.

6. ganeshie8

By unit equilateral triangle do you mean the side length is 1 ?

7. ParthKohli

Yes.

8. ganeshie8

Then simply setup a double integral for the distance expression

9. ParthKohli

How?!

10. ParthKohli

I was wondering if we could use things like radius of gyration, but the radius of gyration is more weighted towards distance, if you know what I mean.

11. ganeshie8

|dw:1443350378977:dw|

12. ganeshie8

$\text{Average distance} = \dfrac{1}{A}\iint \sqrt{x^2+y^2}dA$

13. ParthKohli

That seems nice. So a way to look at the double integral is that we fix the outer thing and vary the inner one throughout that outer thing, then we also vary the outer thing.

14. ganeshie8

Right, double integral over a region does this : 1) evaluate the function "sqrt(x^2+y^2)" at a particular point (x, y) in the region 2) multiply that by the area element in the xy plane : dA

15. ganeshie8

Notice that the average velcity can be expressed using integral as : $\text{Average velocity over (a,b)} = \dfrac{s(b)-s(a)}{b-a} = \dfrac{1}{b-a} \int\limits_{a}^b v(t)\,dt$

16. ganeshie8

$$s$$ is the displacement function

17. ParthKohli

Yeah, I can understand single-variable integrals. Just trying to understand how this thing works. $$dA$$ is basically a really small circular element around $$(x,y)$$ right? Or what is it?

18. ganeshie8

similarly, in our case, average distance within an equilateral triangle can be obtained by taking the integral of the distance function over the triangle, and then dividing by the number of data points (Area)

19. ganeshie8

Yes In single integral, $$dx$$ refers to a small width element. In double integral, $$dA$$ refers to a small area element.

20. ParthKohli

Can we say that $$dA = dxdy$$ or $$dA = \pi (x^2 + y^2) dxdy$$ or something like that? Because I see the $$dxdy$$ always occurring in double integrals.

21. ganeshie8

depends on the coordinate system, if you're using rectangular coordinates, then $$dA = dxdy$$ if you're using polar coordinates, then $$dA = r*drd\theta$$

22. ParthKohli

So it's not a circular element. That makes sense because within the circle, the distance will kinda change.

23. ganeshie8

don't worry about the conversion factors, they are not important as of now.. you need to study jacobians and other stuff which comes later..

24. ParthKohli

Help me through this: it means that if I go $$dx$$ units around the point in the x-direction and $$dy$$ units around the point in the y-direction, it doesn't change the $$\sqrt{x^2+y^2 }$$ term - which is why the area element is $$dA = dx dy$$.

25. anonymous

yes it does

26. ParthKohli

Great. Also the limits of $$x$$ depend on the limits of $$y$$, so it basically means that the inner integral is a function of the outer one.

27. ganeshie8

Maybe, lets take this example problem. Find the center of mass of below 2 dimensional region : |dw:1443351868292:dw|

28. ParthKohli

First, the height of the triangle is $$\sqrt{3}/2$$ so $$y$$ varies from $$-\sqrt{3}/4$$ to $$+\sqrt{3}/4$$. When $$y = \sqrt{3}/4$$, $$x$$ varies from $$-0$$ to $$+0$$. When $$y = -\sqrt{3}/4$$, $$x$$ varies from $$-1/2$$ to $$+1/2$$. In general, for a given $$y$$, $$x$$ varies from $$y/\sqrt{3} - 1/4$$ to $$-y/\sqrt{3} + 1/4$$.

29. ParthKohli

That's great - you understand my love for physics.$x_{CM} = \frac{\displaystyle \int x dm}{ M}$

30. ParthKohli

Area of the whole region: $$\displaystyle \int x^2dx/4$$ from 0 to ???

31. ganeshie8

Mass = density*Area lets just assume that the object shown in above diagram has uniform density of 1

32. ParthKohli

Wow I definitely know how to solve this problem - just tell me the upper limit.

33. ganeshie8

Yes you definitely knew it I took the easy one because I wanted to show you how to set it up using double integrals

34. ganeshie8

finding the coordinates of center of mass is not the goal setting up the integrals correctly is the goal here

35. ParthKohli

OK. If I just let the upper limit be $$X$$, then the area is $$A = \dfrac{X^3}{12}$$ Now if I go $$x$$ units along the curve in the x-direction, and a small width $$dx$$, then the area of this thing is $$\frac{x^2}{4}dx$$ and the mass is $$dm = x^2 dx/4$$ because dm = dA (density = 1).

36. ParthKohli

So yes, life's good so far. Coming back to the original problem... Did I write the limits there correctly though? The $$x$$ and $$y$$ ones.

37. ganeshie8

|dw:1443352602540:dw|

38. ganeshie8

I'm not looking at the original problem yet

39. ParthKohli

$\int ^{+\sqrt{3}/4}_{-\sqrt{3}/4}\int^{-y/\sqrt{3}+1/4 }_{y/\sqrt{3}-1/4 } \sqrt{x^2 + y^2}dx dy$

40. ganeshie8

Not so fast, do you see why the double integral gives the averge value ?

41. ParthKohli

Yeah, we've covered a lot of center of mass and moment of inertia in the class. :)

42. ganeshie8

but you said earlier that you don't know about double integrals

43. ganeshie8

So I'm confused how you're able to setup that double integral in two minutes hmm

44. IrishBoy123

.

45. ParthKohli

I realised that the inner integral is really just a function of the outer integral.

46. ganeshie8

Hmm that doesn't make sense to me but its okay, if you're good, im good.

47. ganeshie8

just evaluate the integral and we're done! there isn't much to it

48. ParthKohli

Just one question to understand if I'm thinking correctly: the limits of the inner integral should be in terms of the variable involved in the outer integral right?

49. ParthKohli

|dw:1443353241031:dw|

50. ParthKohli

oops

51. ParthKohli

the limits on the outer integral are not functions of x... just meant to ask about those on the inner integral

52. ganeshie8

Yes, but again, I don't really know what exactly you're asking... I feel you're rushing

53. ParthKohli

So we first evaluate the inner integral, and since its limits are in terms of $$y$$, we recover a function that is in terms of $$y$$, which is then evaluated as a single-integral.

54. ganeshie8

the bounds in a double integral are the "inequalities" that represent the "region" over which you integrate the function, f(x,y)

55. ganeshie8

maybe find the center of mass of that parabolic region you will see whats going on with the bounds..

56. ParthKohli

Yes... here is how I'm thinking - if we go at a height $$y$$, the bounds of $$x$$ depend on the height $$y$$ as this is not a simple figure like a circle.

57. ParthKohli

Could you input that double integral to Wolfram? I dunno how to. Also divide it by $$\sqrt{3}/4$$ which is the area.

58. ganeshie8

wolfram understands most latex

59. ganeshie8
60. ParthKohli

Interesting, that worked. Can I have the closed form though?

61. ganeshie8

try evaluating it manually $$\sqrt{a^2+x^2}$$ has a closed form

62. ParthKohli

nooooooooooooooooooooooooooooooooooooo

63. ParthKohli

really ugly form, that.

64. ganeshie8
65. ganeshie8

you may try changing it to polar but then the bounds will get ugly

66. ParthKohli

Maybe try evaluating just the inner thing?

67. ganeshie8

notice that the integrand is simply $$r$$ in polar form

68. ParthKohli
69. ParthKohli

is there an integrator that returns the closed form? can software like Mathematica do what WolframAlpha wasn't able to?

70. ganeshie8

what if it returns the answers in terms of logs and inverse hyperbolic tangnets ?

71. ParthKohli

The answer is supposed to be in a really simple form.

72. ganeshie8

i think double integral may be a bad idea if you want closed form there must be some geometric method..

73. ParthKohli

:(

74. ParthKohli

but it's a calculus problem

75. ParthKohli

yeah i mean there are geometrical methods in calc too but

76. ganeshie8

wolfram is not cooperating, so can't do much with that double integral

77. ganeshie8

need to think of somethign else..

78. ParthKohli

here is how I think of it: let's go back to the sum of distance*fraction there. is there any reason whatsoever that the fraction $$r$$ distance away in a circle and the fraction $$r$$ distance away in a triangle should be different? may be a dumb question with a dumb answer but we need to think of this in order to go somewhere

79. ParthKohli

never mind, it really was dumb