Integral with DiracDelta. Can Mathematica be made to solve this?How to solve this integralIntegral of...
Can I bring back Planetary Romance as a genre?
How to avoid making self and former employee look bad when reporting on fixing former employee's work?
Locked my sa user out
Can a planet still function with a damaged moon?
What's the "magic similar to the Knock spell" referenced in the Dungeon of the Mad Mage adventure?
Is it a Munchausen Number?
What is the minimum required technology to reanimate someone who has been cryogenically frozen?
How can I test a shell script in a "safe environment" to avoid harm to my computer?
Origins of the "array like" strings in BASIC
Has everyone forgotten about wildfire?
What is the Ancient One's mistake?
Company stopped paying my salary. What are my options?
How do I minimise waste on a flight?
I might have messed up in the 'Future Work' section of my thesis
What's an appropriate age to involve kids in life changing decisions?
Renting a house to a graduate student in my department
Why use steam instead of just hot air?
"Estrontium" on poster
What is a good way to allow only one non null field in an object
Do Monks gain the 9th level Unarmored Movement benefit when wearing armor or using a shield?
if i accidentally leaked my schools ip address and someone d doses my school am i at fault
Narcissistic cube asks who are we?
Why did Missandei say this?
Are double contractions formal? Eg: "couldn't've" for "could not have"
Integral with DiracDelta. Can Mathematica be made to solve this?
How to solve this integralIntegral of DiracDelta giving an unusual answerHow can I solve this integral analytically?DiracDelta behaves incorrectly on multidimensional integralPartial derivative with Dirac Delta as initial conditionDensity of states from numerical integration and then differentiationIntegral Representation of DiracDeltaCan this integral be calculated using Mathematica?Symbolic IntegralMathematica won't evaluate this integral
$begingroup$
This was an exam question.
$$
int_0^{2 pi} delta(sin^2(theta) -x ) ,dtheta
$$
Direct use of Integrate on it does not give the solution. Is there a trick or workaround? Here is the code I used
ClearAll[theta,x]
integrand = DiracDelta[Sin[theta]^2 - x]
Integrate[ integrand, {theta, 0, 2 Pi}]
Here is the key solution analytical solution

The solution uses this known relation (half way down the Wikipedia page)

Where the sum above is over all zeros of $g(x)$ in the integration interval. Mathematica does not seem to know this relation?
ps. Maple can't do it either.
calculus-and-analysis
$endgroup$
add a comment |
$begingroup$
This was an exam question.
$$
int_0^{2 pi} delta(sin^2(theta) -x ) ,dtheta
$$
Direct use of Integrate on it does not give the solution. Is there a trick or workaround? Here is the code I used
ClearAll[theta,x]
integrand = DiracDelta[Sin[theta]^2 - x]
Integrate[ integrand, {theta, 0, 2 Pi}]
Here is the key solution analytical solution

The solution uses this known relation (half way down the Wikipedia page)

Where the sum above is over all zeros of $g(x)$ in the integration interval. Mathematica does not seem to know this relation?
ps. Maple can't do it either.
calculus-and-analysis
$endgroup$
add a comment |
$begingroup$
This was an exam question.
$$
int_0^{2 pi} delta(sin^2(theta) -x ) ,dtheta
$$
Direct use of Integrate on it does not give the solution. Is there a trick or workaround? Here is the code I used
ClearAll[theta,x]
integrand = DiracDelta[Sin[theta]^2 - x]
Integrate[ integrand, {theta, 0, 2 Pi}]
Here is the key solution analytical solution

The solution uses this known relation (half way down the Wikipedia page)

Where the sum above is over all zeros of $g(x)$ in the integration interval. Mathematica does not seem to know this relation?
ps. Maple can't do it either.
calculus-and-analysis
$endgroup$
This was an exam question.
$$
int_0^{2 pi} delta(sin^2(theta) -x ) ,dtheta
$$
Direct use of Integrate on it does not give the solution. Is there a trick or workaround? Here is the code I used
ClearAll[theta,x]
integrand = DiracDelta[Sin[theta]^2 - x]
Integrate[ integrand, {theta, 0, 2 Pi}]
Here is the key solution analytical solution

The solution uses this known relation (half way down the Wikipedia page)

Where the sum above is over all zeros of $g(x)$ in the integration interval. Mathematica does not seem to know this relation?
ps. Maple can't do it either.
calculus-and-analysis
calculus-and-analysis
edited 3 hours ago
Nasser
asked 3 hours ago
NasserNasser
59.2k491209
59.2k491209
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
You need to give Integrate assumptions:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> 0<x<1]
2/Sqrt[-(-1 + x) x]
Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> x ∈ Reals]
Integrate[DiracDelta[-x + Sin[θ]^2], {θ, 0, 2 π},
Assumptions -> x ∈ Reals]
$endgroup$
$begingroup$
Nice! For some reason, this does not work for exponents other than2(e.g.,Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solveis unable to determine the roots). Any idea how to work around this?
$endgroup$
– AccidentalFourierTransform
3 hours ago
2
$begingroup$
@AccidentalFourierTransform One hack is to replacexwithEulerGamma, that will produce a result forSin[θ]^3 - x, which you can then extrapolate into a generic answer.
$endgroup$
– Carl Woll
2 hours ago
add a comment |
$begingroup$
f[θ_, x_] := Sin[θ]^2 - x
Derivative[1, 0][f][θ, x] /. Solve[{f[θ, x] == 0, 0 < θ < 2 π}, θ, Reals]
Integrate[DiracDelta[x - θ]/Abs[%], {θ, 0, 2 π}] // Total

This code should also work for other functions $f$, presumably.
$endgroup$
$begingroup$
You have an extra[θ, x], and yourSolvewould work better if you added the domainReals. Probably more robust than just relying onIntegrate.
$endgroup$
– Carl Woll
2 hours ago
$begingroup$
@CarlWoll Ah, yes, thank you!
$endgroup$
– AccidentalFourierTransform
2 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f197963%2fintegral-with-diracdelta-can-mathematica-be-made-to-solve-this%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You need to give Integrate assumptions:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> 0<x<1]
2/Sqrt[-(-1 + x) x]
Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> x ∈ Reals]
Integrate[DiracDelta[-x + Sin[θ]^2], {θ, 0, 2 π},
Assumptions -> x ∈ Reals]
$endgroup$
$begingroup$
Nice! For some reason, this does not work for exponents other than2(e.g.,Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solveis unable to determine the roots). Any idea how to work around this?
$endgroup$
– AccidentalFourierTransform
3 hours ago
2
$begingroup$
@AccidentalFourierTransform One hack is to replacexwithEulerGamma, that will produce a result forSin[θ]^3 - x, which you can then extrapolate into a generic answer.
$endgroup$
– Carl Woll
2 hours ago
add a comment |
$begingroup$
You need to give Integrate assumptions:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> 0<x<1]
2/Sqrt[-(-1 + x) x]
Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> x ∈ Reals]
Integrate[DiracDelta[-x + Sin[θ]^2], {θ, 0, 2 π},
Assumptions -> x ∈ Reals]
$endgroup$
$begingroup$
Nice! For some reason, this does not work for exponents other than2(e.g.,Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solveis unable to determine the roots). Any idea how to work around this?
$endgroup$
– AccidentalFourierTransform
3 hours ago
2
$begingroup$
@AccidentalFourierTransform One hack is to replacexwithEulerGamma, that will produce a result forSin[θ]^3 - x, which you can then extrapolate into a generic answer.
$endgroup$
– Carl Woll
2 hours ago
add a comment |
$begingroup$
You need to give Integrate assumptions:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> 0<x<1]
2/Sqrt[-(-1 + x) x]
Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> x ∈ Reals]
Integrate[DiracDelta[-x + Sin[θ]^2], {θ, 0, 2 π},
Assumptions -> x ∈ Reals]
$endgroup$
You need to give Integrate assumptions:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> 0<x<1]
2/Sqrt[-(-1 + x) x]
Unfortunately, Integrate is not quite smart enough to use the assumption x ∈ Reals:
Integrate[DiracDelta[Sin[θ]^2-x], {θ, 0, 2 π}, Assumptions -> x ∈ Reals]
Integrate[DiracDelta[-x + Sin[θ]^2], {θ, 0, 2 π},
Assumptions -> x ∈ Reals]
answered 3 hours ago
Carl WollCarl Woll
77.7k3102205
77.7k3102205
$begingroup$
Nice! For some reason, this does not work for exponents other than2(e.g.,Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solveis unable to determine the roots). Any idea how to work around this?
$endgroup$
– AccidentalFourierTransform
3 hours ago
2
$begingroup$
@AccidentalFourierTransform One hack is to replacexwithEulerGamma, that will produce a result forSin[θ]^3 - x, which you can then extrapolate into a generic answer.
$endgroup$
– Carl Woll
2 hours ago
add a comment |
$begingroup$
Nice! For some reason, this does not work for exponents other than2(e.g.,Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solveis unable to determine the roots). Any idea how to work around this?
$endgroup$
– AccidentalFourierTransform
3 hours ago
2
$begingroup$
@AccidentalFourierTransform One hack is to replacexwithEulerGamma, that will produce a result forSin[θ]^3 - x, which you can then extrapolate into a generic answer.
$endgroup$
– Carl Woll
2 hours ago
$begingroup$
Nice! For some reason, this does not work for exponents other than
2 (e.g., Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solve is unable to determine the roots). Any idea how to work around this?$endgroup$
– AccidentalFourierTransform
3 hours ago
$begingroup$
Nice! For some reason, this does not work for exponents other than
2 (e.g., Sin[θ]^3 - x). My code does not work either, presumably for the same reason (Solve is unable to determine the roots). Any idea how to work around this?$endgroup$
– AccidentalFourierTransform
3 hours ago
2
2
$begingroup$
@AccidentalFourierTransform One hack is to replace
x with EulerGamma, that will produce a result for Sin[θ]^3 - x, which you can then extrapolate into a generic answer.$endgroup$
– Carl Woll
2 hours ago
$begingroup$
@AccidentalFourierTransform One hack is to replace
x with EulerGamma, that will produce a result for Sin[θ]^3 - x, which you can then extrapolate into a generic answer.$endgroup$
– Carl Woll
2 hours ago
add a comment |
$begingroup$
f[θ_, x_] := Sin[θ]^2 - x
Derivative[1, 0][f][θ, x] /. Solve[{f[θ, x] == 0, 0 < θ < 2 π}, θ, Reals]
Integrate[DiracDelta[x - θ]/Abs[%], {θ, 0, 2 π}] // Total

This code should also work for other functions $f$, presumably.
$endgroup$
$begingroup$
You have an extra[θ, x], and yourSolvewould work better if you added the domainReals. Probably more robust than just relying onIntegrate.
$endgroup$
– Carl Woll
2 hours ago
$begingroup$
@CarlWoll Ah, yes, thank you!
$endgroup$
– AccidentalFourierTransform
2 hours ago
add a comment |
$begingroup$
f[θ_, x_] := Sin[θ]^2 - x
Derivative[1, 0][f][θ, x] /. Solve[{f[θ, x] == 0, 0 < θ < 2 π}, θ, Reals]
Integrate[DiracDelta[x - θ]/Abs[%], {θ, 0, 2 π}] // Total

This code should also work for other functions $f$, presumably.
$endgroup$
$begingroup$
You have an extra[θ, x], and yourSolvewould work better if you added the domainReals. Probably more robust than just relying onIntegrate.
$endgroup$
– Carl Woll
2 hours ago
$begingroup$
@CarlWoll Ah, yes, thank you!
$endgroup$
– AccidentalFourierTransform
2 hours ago
add a comment |
$begingroup$
f[θ_, x_] := Sin[θ]^2 - x
Derivative[1, 0][f][θ, x] /. Solve[{f[θ, x] == 0, 0 < θ < 2 π}, θ, Reals]
Integrate[DiracDelta[x - θ]/Abs[%], {θ, 0, 2 π}] // Total

This code should also work for other functions $f$, presumably.
$endgroup$
f[θ_, x_] := Sin[θ]^2 - x
Derivative[1, 0][f][θ, x] /. Solve[{f[θ, x] == 0, 0 < θ < 2 π}, θ, Reals]
Integrate[DiracDelta[x - θ]/Abs[%], {θ, 0, 2 π}] // Total

This code should also work for other functions $f$, presumably.
edited 2 hours ago
answered 3 hours ago
AccidentalFourierTransformAccidentalFourierTransform
5,18311042
5,18311042
$begingroup$
You have an extra[θ, x], and yourSolvewould work better if you added the domainReals. Probably more robust than just relying onIntegrate.
$endgroup$
– Carl Woll
2 hours ago
$begingroup$
@CarlWoll Ah, yes, thank you!
$endgroup$
– AccidentalFourierTransform
2 hours ago
add a comment |
$begingroup$
You have an extra[θ, x], and yourSolvewould work better if you added the domainReals. Probably more robust than just relying onIntegrate.
$endgroup$
– Carl Woll
2 hours ago
$begingroup$
@CarlWoll Ah, yes, thank you!
$endgroup$
– AccidentalFourierTransform
2 hours ago
$begingroup$
You have an extra
[θ, x], and your Solve would work better if you added the domain Reals. Probably more robust than just relying on Integrate.$endgroup$
– Carl Woll
2 hours ago
$begingroup$
You have an extra
[θ, x], and your Solve would work better if you added the domain Reals. Probably more robust than just relying on Integrate.$endgroup$
– Carl Woll
2 hours ago
$begingroup$
@CarlWoll Ah, yes, thank you!
$endgroup$
– AccidentalFourierTransform
2 hours ago
$begingroup$
@CarlWoll Ah, yes, thank you!
$endgroup$
– AccidentalFourierTransform
2 hours ago
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f197963%2fintegral-with-diracdelta-can-mathematica-be-made-to-solve-this%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown