That really complicated integral lol

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import math

dx = 10**-6
dy = 10**-6
dz = 10**-6

x = 0.1
y = 0.1
z = 0.1

def tripleVariableFunction(x,y,z):

  numerator = x*math.sin(y)*(math.sin(y)*math.cos(z)-x)
  denominator = (4*(math.cos(y)-1)**2 + (x-math.sin(y)*math.cos(z))**2 + (math.sin(y)*math.sin(z))**2)**(1.5)


  return numerator/denominator

xIntegral = 0
yIntegral = 0
zIntegral = 0

while z <= 6.28:
  while y <= 3.14:
    while x <= 1:
      xIntegral += tripleVariableFunction(x,y,z)*dx

      x += dx
    yIntegral += xIntegral*dy
    y += dy
  zIntegral += yIntegral*dz
  z += dz

print(zIntegral)

So, I think the integral is divergent because at x=0,y=0,z=0x = 0, y = 0, z = 0 the function value goes to infinity. The integral value, of course, skyrockets. So, I have tried running the integral as close to zero as possible. It is very clear how the integral value increases by crazy amounts when x,y,z0x,y,z \rightarrow 0, whereas when the values are 0.1 the integral is much smaller.

Note by Krishna Karthik
2 weeks, 1 day ago

No vote yet
1 vote

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

Sort by:

Top Newest

@Krishna Karthik i have made some changes in the code
and now the answer is 15.15-15.15

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import math

dx = 10**-6
dy = 10**-6
dz = 10**-6

x = 0.01
y = 0.01
z = 0.01

def tripleVariableFunction(x,y,z):

  numerator = x*math.sin(y)*(math.sin(y)*math.cos(z)-x)
  denominator = (4*(math.cos(y)-1)**2 + (x-math.sin(y)*math.cos(z))**2 + (math.sin(y)*math.sin(z))**2)**(1.5)


  return numerator/denominator

xIntegral = 0
yIntegral = 0
zIntegral = 0

while z <= 6.28:
  while y <= 3.14:
    while x <= 1:
      xIntegral += tripleVariableFunction(x,y,z)*dx

      x += dx
    yIntegral += xIntegral*dy
    y += dy
  zIntegral += yIntegral*dz
  z += dz

print(zIntegral)



# ========================== RESTART: E:\test.py (2).txt =========================
# -15.551517796734224

Lil Doug - 2 weeks, 1 day ago

Log in to reply

Ok, so you have adjusted accuracy and brought the values of x,y and z closer to 0. But that doesn't change the fact that f(x,y,z)f(x,y,z) is undefined at x,y,zx,y,z = 0

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik but if we want a perfect answer than ,then we have to do that as much as we want

by the way how to write that in python in brilliant ,i just forgot

Lil Doug - 2 weeks, 1 day ago

Log in to reply

@Lil Doug That's ok, just type three characters that look like this: `

Above and below your code, on new lines. At the top after the three character thing, on the same line, type "python".

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

I have tried bringing x,y, and z closer to 0, but the value of the integral only gets greater (by large amounts). I think this proves its divergence.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

Bro I like your new profile pic and description. It screams: "Badass; rich guy"

Krishna Karthik - 15 hours ago

Log in to reply

Thanks,by the way @Steven Chase seems me a badass guy.

Lil Doug - 15 hours ago

Log in to reply

@Krishna Karthik I have posted the problem here
And this problem need this hard integral , which we were solving.

Lil Doug - 2 weeks, 1 day ago

Log in to reply

But how? The integral is divergent. Did you actually manage to solve the integral?

Krishna Karthik - 2 weeks ago

Log in to reply

@Krishna Karthik i was getting 0.4 many times, therefore I considered it as a right answer.

Lil Doug - 2 weeks ago

Log in to reply

@Lil Doug But the answer that was on the problem was 0.201

Krishna Karthik - 2 weeks ago

Log in to reply

@Krishna Karthik @Krishna Karthik after that integral my calculation says that we have to divide by 2

Lil Doug - 2 weeks ago

Log in to reply

@Lil Doug Ahh ok. Fair enough :)

Krishna Karthik - 2 weeks ago

Log in to reply

@Lil Doug Let's see what Steven Chase says about it :)

Krishna Karthik - 2 weeks ago

Log in to reply

@Lil Doug Sounds like a really cool question!!

Krishna Karthik - 2 weeks ago

Log in to reply

@Krishna Karthik I think the answer should be positive.

Lil Doug - 2 weeks, 1 day ago

Log in to reply

I'll check.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

There is one small thing: the function skyrockets to infinity when x = 0, y = 0, and z = 0

Personally, I think the integral is divergent.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik i think when i will post this problem , it will be the hardest problem of whole electricty and magnetsim in brilliant.

Lil Doug - 2 weeks, 1 day ago

Log in to reply

@Lil Doug Lmao🤣

Good one bud

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Lil Doug What's hard about triple integrals is that since they are in 4 dimensions, you can't visualise them.

But I think evidence shows that the integral is divergent, much like 011xdx\displaystyle \int_{0}^{1} \frac{1}{x} dx is.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik bro the answer is coming in 1 second ,how it is possible ,it is very hard integral??

Lil Doug - 2 weeks, 1 day ago

Log in to reply

I was wrong about the computer's capability lmao. The number of iterations are manageable. Previously I thought it was too big, but that was just a code error.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik i am surprising by new answer everytime

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import math

dx = 10**-6
dy = 10**-6
dz = 10**-6

x = 0.0001
y = 0.0001
z = 0.0001

def tripleVariableFunction(x,y,z):

  numerator = x*math.sin(y)*(math.sin(y)*math.cos(z)-x)
  denominator = (4*(math.cos(y)-1)**2 + (x-math.sin(y)*math.cos(z))**2 + (math.sin(y)*math.sin(z))**2)**(1.5)


  return numerator/denominator

xIntegral = 0
yIntegral = 0
zIntegral = 0

while z <= 6.28:
  while y <= 3.14:
    while x <= 1:
      xIntegral += tripleVariableFunction(x,y,z)*dx

      x += dx
    yIntegral += xIntegral*dy
    y += dy
  zIntegral += yIntegral*dz
  z += dz

print(zIntegral)

====================== RESTART: E:\test.py (2).txt ======================
-0.39914323545949787
>>>     

Lil Doug - 2 weeks, 1 day ago

Log in to reply

Ok, got it. Now I'm getting something around the 0.4 ballpark.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik what do you mean by ballpark?

Lil Doug - 2 weeks, 1 day ago

Log in to reply

@Lil Doug Around the 0.4 mark. Around there.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik bro so which answer is correct??

Lil Doug - 2 weeks, 1 day ago

Log in to reply

Let me do some more testing.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

What??? I lowered the x y and z values toward zero more, and now I'm getting 47. ???

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik ha ha ha ha i laughed so hard by reading the above comment.

Lil Doug - 2 weeks, 1 day ago

Log in to reply

@Lil Doug Yeah; there's no doubt about it; the integral you gave me is divergent. You can see it clearly as the integral value skyrockets as x, y and z approach zero. And you have a division by zero error the compiler gives when x y and z = 0.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik @Krishna Karthik but why the integral is divergent ? the problem which i am making should definitey have some answer .

Lil Doug - 2 weeks, 1 day ago

Log in to reply

@Lil Doug Try to take a look at the integral again. Maybe there's some other answer, or something.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Lil Doug Have you got the answer for the problem? How have you got the answer if the integral is incorrect?

Krishna Karthik - 2 weeks ago

Log in to reply

Anyway, gtg. See ya.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik what this above comment mean ??

Lil Doug - 2 weeks, 1 day ago

Log in to reply

@Lil Doug Gtg stands for "got to go"

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Krishna Karthik @Krishna Karthik so what about the integral. Did Steven sir helped you??

Lil Doug - 2 weeks ago

Log in to reply

@Lil Doug Not yet; I haven't heard from him

Krishna Karthik - 2 weeks ago

Log in to reply

@Krishna Karthik let me the run the code 10001000 time by different values .
and then we will take the average of all those 10001000 values.ha ha ha

Lil Doug - 2 weeks, 1 day ago

Log in to reply

Lol

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

Bruh

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

Ok, I might just ask Steven Chase or someone to confirm what's going on.

Krishna Karthik - 2 weeks, 1 day ago

Log in to reply

@Neeraj Anand Badgujar

So the integral you wished for me to calculate was wrong? That makes sense. I just saw the numerical solution by Steven Chase. It was quite brilliant.

Krishna Karthik - 2 weeks ago

Log in to reply

@Krishna Karthik if we calculate my integral very accurately so may be we will get correct answer?

Lil Doug - 2 weeks ago

Log in to reply

×

Problem Loading...

Note Loading...

Set Loading...