# Tag Info

5

With V10 one can see that the special case p = -1 is explicitly excluded: FunctionDomain[Integrate[x^p, x], p, Reals] Reason: The general formula Integrate[x^p, x] would result in a division by zero error with p = -1: Limit[Integrate[x^p, x], p -> -1] Integrating over a certain interval one gets the expected results: Integrate[x^#, x] ...

2

The reason is because Mathematica does not know anything about f[x]. What if f[x] was 1? then the integrand will be zero. One way is to make your own rule for this case. ClearAll[x, y, h, f]; rul0[x_] := (x /. Integrate[1 - f[y_], {y_, a_, b_}] :> ((b - a) - Integrate[f[y], {y, a, b}])) Simplify[Integrate[1 - f[x], {x, 0, h}], TransformationFunctions ...

0

if you are looking at the final result then this could help. int = Integrate[ 1/Sqrt[(y1)^2 + (y2)^2 + (y3)^2]*1/(1 + (y3)^2)* Exp[-2*((y1)^2 + (y2)^2)/(1 + (y3)^2)], {y1, -Infinity, Infinity}, {y2, -Infinity, Infinity}]; NIntegrate[int, {y3, -10, 10}] (*10.2436*)

4

There exist few typos in your kernel definition. This is how your kernel looks assuming a=2 (we denote it as A while defining the kernel as Kpart in the following). Please utilize the code from here to solve your problem. Below I changed the constants and functional arguments of FredholmKind2 to fit your particular problem. n = 20;(*number of ...

3

Your equation has a sign error for the inverse Fourier transform. A simpler prescription is I InverseFourierTransform[FourierTransform[f[t], t, w]/w, w, x] Although there is a lrge range of function for which this works, it will of course fail for all those functions for which the Fourier transform can't be calculated. Anyway, it does work for ...

1

As I said in a comment I object to the downvaluing of my solution by somebody anonymus without giving the reasong for it. Now you can convince yourself here that my solution of the real problem is correct. And, consequently, that the second integral of "identy" (and sequel) is not. Here we go: I gather from your first lines that you wanted to calculate ...

4

In Version 10 you can now create ImplicitRegions and Integrate over them: region = ImplicitRegion[And @@ {0 <= x, x <= 1 - y, -1 <= y, x + 2 y <= 2}, {x, y}] Now Integrate[x + y, {x, y} ∈ region] 2/3

0

I think what you mean in your second integral is the integral between y^2/2 and \[Infinity]: Integrate[(E^-t ArcCos[y/(Sqrt[2] Sqrt[t])])/\[Pi], {t, 1/2 y^2, \[Infinity]}] It is returned unevaluated by Mathematica: (* $\int_{\frac{y^2}{2}}^{\infty } \frac{e^{-t} \text{ArcCos}\left[\frac{y}{\sqrt{2} \sqrt{t}}\right]}{\pi } \, dt$*) Therefore, let's ...

3

My version of Mathematica has no problems calculating analytically the integral $\int_{x-b}^{b+x} 2 r (l-r) \cos ^{-1}\left(\frac{s^2+x^2-b^2}{2 s x}\right) \, dr$ The result looks nice (IMHO) rather than "ugly". $\frac{1}{9} b^3 \left(9 L \pi -2 (2+z) (8+z (2+z)) \text{EllipticE}\left[\frac{4 (1+z)}{(2+z)^2}\right]+2 z (2+z)^2 ... 9 In Mathematica 10, this computation may be made as follows: Clear @ r volSphere9[r_] = RegionMeasure[Ball[ConstantArray[0, 10], r]] (π^5 r^10)/120 volSphere9[1000.] 2.55016*10^30 7 The sum of the squares should be less than or equal to r^2 rather than r. d = 10; r = 1000; F = Piecewise[{{1, Sum[x[i]^2, {i, d}] <= r^2}}, 0]; NIntegrate[F, {x[1], -1000, 1000}, {x[2], -1000, 1000}, {x[3], -1000, 1000}, {x[4], -1000, 1000}, {x[5], -1000, 1000}, {x[6], -1000, 1000}, {x[7], -1000, 1000}, {x[8], -1000, 1000}, {x[9], -1000, 1000}, ... 0 This is my solution: n[R_, k_] := k - IntegerPart[(1 - R)/(2/(2 k + 1))]; sum[k_, R_] := N[((-1)^n[R, k] (t[k, r[n[R, k], k]] - t[k, R]) + Sum[(-1)^j (t[k, r[j, k]] - t[k, r[j - 1, k]]), {j, n[R, k] + 1, k}])]; r[x_, k_] := 1/(2 k + 1) + (2 x )/(2 k + 1); t[k_, r_] = -(( 2 FresnelS[Sqrt[1 + 2 k] Sqrt[r]])/((1 + 2 k)^(3/2) \[Pi])) + ( ... 10 Here is the derivation promised earlier. I have chosen to create a new answer in order not to mix things up and because it shows some handling which I like to call "man-machine" interaction with Mathematica. And, sorry for the "Greeks", but I find it very cumbersome to reedit them :-($Version "8.0 for Microsoft Windows (64-bit) (October 7, 2011)" ...

8

Update The updated question clarifies the problem. As far as I can tell, this is a bug, a rather strange bug. I've tracked the problem down to the definition L = 1 still existing on the parallel kernels. This removes the problem: Put ParallelEvaluate@ClearAll["GlobalL"] after the second ClearAll["Global*"] halfway through the code. Then ...

0

just an extended comment: In Win7, MMA7 your original question is solved correctly k = 1 r1 = Block[{r}, NIntegrate[Sqrt[r] Abs[Cos[(k + 1/2) Pi r]], {r, 0, 1}]] r2 = Assuming[k \[Element] Integers && k \[GreaterSlantEqual] 0, Integrate[1/Sqrt[2] Sqrt[r (1 + Cos[2 (k + 1/2) Pi r])], {r, 0, 1}]] // N rDiff = r1 - r2 (*out*) 1 0.413231743899931 ...

4

Here is another way to get points equally spaced by chord-length. It will give a good result if the chord length is relatively small compared to the maximum radius of curvature along the curve. (If, say, the chord length is no greater than the maximum radius, then between successive points, the turning will be less 60 deg., and the difference between the ...

4

The exact analytic soultion 1. Introduction The problem was still intriguing me with the result of a further study which I present in the following, for clarity as another solution. I have chosen to write the formulas in the more theoretical text in traditonal form. Abstract We calculate here the explcit analytic solution for the integral $f(k,R)=\int ... 4 ImplicitRegion (and ParametricRegion) represent a region. They are not for plotting. Thus RegionPlot is not even remotely an alternative. You can do many operations on regions that you can look up in the documentation centre. Just a few examples: you can compute their size, decide if a point is within, compute the distance between them, find their ... 2 In mathematics, a set can be write in two(or more) form: one is {3x | x in [0,1]}, the other {x | P(x)}, where P is called a propositional function or predicate. Since Mathematica have a great power of dealing with quantifiers, once you can write a set in the second form above, you can do plenty of things and tricks that you would have thought to have ... 1 No apparent complication in v10 under Windows: Integrate[Sqrt[w/2 (w/2 + u + v)], w] (Sqrt[w] Sqrt[2 u + 2 v + w] (Sqrt[w] (u + v + w) Sqrt[2 u + 2 v + w] - 2 ((u + v)^2) Log[Sqrt[w] + Sqrt[2 u + 2 v + w]]))/(4 Sqrt[w (2 u + 2 v + w)]) 12 In this second answer I give the cause for the mismatch in the integrals, show how to remove it, and make a suggestion to improve the function Integrate[]. Simplified restatement of the problem In order to focus on the core of the problem we consider the simpler integral$\int_0^1 \sqrt{\cos (2 π k r)+1} \, dr$. It has the square root and the cosine ... 5 We can find a 7th order polynomial that meets the requirement if we minimise the$\infty$-norm. For simplicity I construct an array of {x, 6 ArcTan[x]} over the required range and plug it into FindFit, no doubt there are better ways. {a, b} = {-1, 1}/Sqrt[3]; data = Table[{x, 6 ArcTan[x]}, {x, a, b, (b - a)/1000.}]; n = 7; expr = Sum[c[i] x^i, {i, 1, n, ... 2 Assuming by ln you mean the natural logarithm, in Mathematica this is entered as Log Integrate[t^z Log[t], {t, x, y}, Assumptions -> {z ∈ Integers, 0 < x < y}] 16 After a lengthy study (I'm using version 8) I conclude that there is a bug in Mathematica in the Integrate function when applied to a Sqrt integrand. Ok. let's go (some patience is required because of the long text) Let us define the functions corresponding to your integrals. Remark: because of the relation$1 + cos(2x) = 2 cos^2(x)$the two forms of ... 4 Partial sums of this sequence are given by: Sum[(-1)^(n + 1) Cos[3^n x]^3/3^n, {n, 1, m}] (* output: 1/4 Cos[3 x] - 1/4 (-(1/3))^m Cos[3^(1 + m) x] *) For real$x$, we know this converges because$\cos(3^{1+m}x)$is bounded. Mathematica does not assume$x$is real and, as Bob Hanlon notes, will produce the correct result by evaluating a partial sum, ... 6 Taylor polynomials of order n aren't necessarily the nth degree polynomials that optimally approximate a function on a given interval. We can use linear least squares to find the optimal polynomials for a fixed n. inn[f_, g_, x_] := Integrate[f g, {x, -1/Sqrt[3], 1/Sqrt[3]}] LeastSquarePolynomial[f_, x_, n_] := With[{pows = x^Range[0, n]}, pows . ... 8 From Weierstrass Approximation Theorem we know there is such a polynomial, moreover there are infinitely many polynomials satisfying given criterion. Therefore we would like to find those ones of the minimal order. Since we are supposed to exploit series approximations we define a polynomial of n - th order approximating 6 ArcTan[x] for x such that ... 4 These singularities in$g(\cdot,y)$are all removable. There are eight singular values of y, depending only on a, and you can take the limit as$y\rightarrow s$for each singular value$s$and obtain limit for all but finitely many values of$x$. Those are also removable by taking a limit. The function is still continuous, smooth, bounded, etc. The values ... 4 I said in a comment that one could "factor" out ((-1 + a y^2 (1 + y)^2)^2 from the numerator. What I meant was that numerator is$O(((-1 + a y^2 (1 + y)^2)^2)$. The integral is a complicated expression, so the easiest way to examine it, it seemed to me, is to look at the coefficients of the power series expansion about the real roots of the denominator. ... 2 A fix For s, you could use s = x \[Function] Piecewise[{{Cos[x], -Pi/2 <= Mod[x, 2 π, -π] <= Pi/2}}]; Integrate[s[t], {t, -8, 6}] (* 5 + Sin[6] *) The problem The problem with the original ff and s is that the function calls itself. Now consider ff[t] or s[t]. None of the conditions will evaluate to False so "the Piecewise function is returned ... 1 You could define your function as f[x_] := 2 Mod[x, 1] then Integrate[f[x], {x, 0, 5}] yields 5 (as expect 5 triangles of area 1) To plot: Plot[f[x], {x, -4, 4}, Exclusions -> None] 1 I assume that |...| means Abs[...]. Define the symbolic integral. int[r0_?NumericQ, k_?NumericQ] := Integrate[Sqrt[r] Abs[Cos[(k + 1/2) \[Pi] r]], {r, r0, 1}] Define the numerical integral. intN[r0_?NumericQ, k_?NumericQ] := NIntegrate[Sqrt[r] Abs[Cos[(k + 1/2) \[Pi] r]], {r, r0, 1}] Compare these integrals for your chosen parameter values, using 1/2 ... 1 I get the same result from NIntegrate and Integrate. Integrate[Sqrt[r] Cos[(k + 1/2) Pi r], {r, R, 1}, Assumptions -> R > 0] /. {k -> 10, R -> 0.5} NIntegrate[Sqrt[r] Cos[(10 + 1/2) Pi r], {r, 0.5, 1}] Output: 0.0459518 0.0459518 4 To compute$\nabla^nr$for arbitrary integer$n$, you can use the built-in tensor derivative syntax. For example, you can compute the second-derivative$\nabla^2r$using r = Sqrt[x^2 + y^2 + (z - a)^2]; X = {x, y, z}; D[r, {X, 2}] To get an answer in terms of$r\$, you can sort of cheat your way to the correct answer via the following modification: r = ...

Top 50 recent answers are included