Complex output from a real integral

In summary, the conversation discusses an integral calculation in Mathematica using a specific code. One participant suggests converting the code into conventional algebraic expressions for easier analysis, while the other suggests starting a new thread in the calculus forum to discuss the mathematical aspect of the problem.
  • #1
member 428835
Hi PF!

I am integrating the following

Code:
sin\[Theta][x_, \[Alpha]_] := Sqrt[(2 - 2 x^2)/(
 3 - 4 x Cos[\[Alpha]] + Cos[2 \[Alpha]])]

cos\[Theta][x_, \[Alpha]_] := Sqrt[(Cot[\[Alpha]] - x Csc[\[Alpha]])/(
 1 + 2 x Cot[\[Alpha]] Csc[\[Alpha]] - 2 Csc[\[Alpha]]^2)]

\[Rho][x_, \[Alpha]_] := Sqrt[(3 - 4 x Cos[\[Alpha]] + 
    Cos[2 \[Alpha]]) Csc[\[Alpha]]^2]/Sqrt[2]

dn\[Phi]b[j_, x_, \[Alpha]_, L_] := 
 j LegendreP[j, L, 
     cos\[Theta][
      x, \[Alpha]]] (-Sqrt[1 - x^2] sin\[Theta][x, \[Alpha]] + 
      x cos\[Theta][x, \[Alpha]]) \[Rho][x, \[Alpha]]^(j - 1) + 
   sin\[Theta][x, \[Alpha]] D[
     LegendreP[j, L, z], {z, 
      1}] (Sqrt[1 - x^2] cos\[Theta][x, \[Alpha]] + 
      x sin\[Theta][x, \[Alpha]]) \[Rho][x, \[Alpha]]^(j - 1) /. 
  z -> cos\[Theta][x, \[Alpha]]

b[\[Alpha]_] := Cos[\[Alpha]]

NIntegrate[dn\[Phi]b[3, x, \[Pi]/3, 1], {x, b[\[Pi]/3], 1}]
The output for this integral is ##-1.1331 - 1.17012 i##. A plot of the integrand is attached. There is a singularity, but the imaginary component seems wrong. Any help?
 

Attachments

  • int.pdf
    15.1 KB · Views: 303
Physics news on Phys.org
  • #2
1. If you would like assistance, it would help if you converted as much as you can of that code into conventional algebraic & analysis symbolic expressions that don't require "\special symbols", language-specific syntax, and (I imagine) version-specific built-in or special functions.
2. If that integrand is giving you a non-Real result, then presumably your integration path is responsible. But I have no idea where to find that specified within the code (because I don't happen to be fluent in that language).
 
  • Like
Likes FactChecker and BvU
  • #3
JMz said:
1. If you would like assistance, it would help if you converted as much as you can of that code into conventional algebraic & analysis symbolic expressions that don't require "\special symbols", language-specific syntax, and (I imagine) version-specific built-in or special functions.
I'll temper that by saying that having code that can be copied and directly pasted into Mathematica is very useful when trying to help on the technical aspects of Mathematica.

However, @joshmccraney, I think that the problem here is not Mathematica but mathematics. You should start a new thread in the calculus forum with a mathematical description of the integral.
 
  • Like
Likes JMz
  • #4
My apologies, @joshmccraney, for failing to notice that the thread's keyword is, in fact, Mathematica. (I suspected as much but failed to recognize that expressing the OP in Mathematica with that keyword was entirely appropriate -- even though the problem does indeed seem to lie within math, not Math.)
 
  • #5
Thank you both. I'll create another thread, as it was unclear to me whether Mathematica was the culprit or the actual math.
 
  • #6
Sounds good. (Great thumbnail, BTW. ;-)
 
  • Like
Likes member 428835
  • #7
Thanks! I'm a huge fan!
 
  • #8
(Me, too.)
 

Related to Complex output from a real integral

1. What is a complex output from a real integral?

A complex output from a real integral is a mathematical concept that involves the use of complex numbers to represent the result of an integral. It occurs when the function being integrated has complex values or when the limits of the integral are complex numbers.

2. How does a complex output differ from a real output?

A complex output differs from a real output in that it includes both a real and imaginary component, while a real output only consists of real numbers. In other words, a complex output has a complex number as its solution, while a real output has a real number as its solution.

3. What are some real-life applications of complex outputs from real integrals?

Complex outputs from real integrals have numerous applications in physics, engineering, and other scientific fields. They are used to solve problems involving alternating currents, quantum mechanics, and electromagnetic fields, among others.

4. How do you calculate a complex output from a real integral?

To calculate a complex output from a real integral, you can use a variety of methods, such as the Cauchy-Riemann integral theorem, contour integration, or the residue theorem. These methods involve manipulating the complex-valued function being integrated and using complex analysis techniques.

5. Are there any limitations or challenges when dealing with complex outputs from real integrals?

Yes, there can be limitations and challenges when dealing with complex outputs from real integrals. Some functions may not have a complex output, while others may have multiple possible solutions. Additionally, complex analysis techniques can be more complex and require a strong understanding of mathematical concepts.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
917
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
13
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
607
Replies
3
Views
743
Replies
6
Views
998
  • Introductory Physics Homework Help
Replies
6
Views
602
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top