Tag Info

New answers tagged

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])) + ( ...


8

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)" ...


5

The problem in the posted code is that you have epsilon in place of Element. The following returns n Pi / L in both V9 and V10: u[n_, x_] := If[x <= 0 || x >= L, 0, Sqrt[2/L] Sin[n π x/L]] φ[n_, k_] := Assuming[{n ∈ Integers, L > 0}, FourierTransform[u[n, x], x, k, FourierParameters -> {0, -1}]] η[n_, k_] = Assuming[{n ∈ Integers, L > ...


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 = ...


1

r[x_, y_, z_] = Sqrt[x^2 + y^2 + (z - a)^2]; D[r[x, y, z], #] & /@ {x, y, z} {x/Sqrt[x^2 + y^2 + (-a + z)^2], y/Sqrt[ x^2 + y^2 + (-a + z)^2], (-a + z)/Sqrt[x^2 + y^2 + (-a + z)^2]} or more simply, % == D[r[x, y, z], {{x, y, z}}] True %% == {x, y, z - a}/r[x, y, z] True EDITED to add higher order partial derivatives Second ...


4

Mathematica 10 provides new functionality dealing with curves, (see e.g. the Vector Analysis tutorial) like ArcLength, ArcCurvature and especially FrenetSerretSystem: FrenetSerretSystem[{ x1, ..., xn}, t] gives the generalized curvatures and Frenet-Serret basis for the parametric curve x[t] i.e. it returns {{ k1, ..., k(n-1)}, { e1, ..., en}}, where ki ...


6

It is not quite clear, what do you you want to get out of the answer. Would you like to compare Maple and Mma and understand, which one is better ? Or would you like to understand the alternative forms of taking this integral? Or the reason, why the results of Marple and Mma are different? Or transform the Mma result in terms of xand y? Or, ...


0

For Element[{m, x, y}, Reals] the function is real; however, numerical noise can result in an imaginary artifact that can be removed with Chop int[m_, x_, y_] = Assuming[{Element[{m, x, y}, Reals]}, Integrate[m^2/((x - m^2)^2 + y^2), m] // FullSimplify] (I*(Sqrt[-x - I*y]*ArcTan[m/Sqrt[-x - I*y]] - Sqrt[-x + I*y]*ArcTan[m/Sqrt[-x + ...


2

I think I solved this problem. The error message was due to the fact that Mathematica cannot perform the internal integration, so I split the two integrations and used NIntegrate instead of the symbolic integration: p[z1_?NumericQ, R_?NumericQ, z_?NumericQ] := -NIntegrate[ BesselK[0, x/Ld]*x* ArcSin[(2*x)/( Sqrt[(z1)^2 + (x + 7.6)^2] + ...


5

The problem is the ByteCount of H is ~630 KB, so Simplify will run forever. ComplexExpand[ With[{z = x + I y}, E^-Sqrt[z^2]/(Sqrt[z^2]+Sqrt[z^2] Cosh[Sqrt[z^2]]+Sqrt[z^2] Sinh[Sqrt[z^2]]) ] ] // ByteCount (* 629392 *) Here are two partial workarounds. I call these workarounds because it proves H is not analytic, but it doesn't derive it i.e. we ...


1

Tweak Solution Since Seth has provided 2 answers, I thought I might also put up another answer. My motivation for separating this from my original answer is that ... my original answer is a self-contained mathematical solution in transformations of random variables, essentially striving to side-step Mathematica's use of Boole which was not working, ...


0

I spent some additional time on this problem and believe I MAY have solved it in a pretty general way with Mathematica. But I'm not sure and I still think there's more help needed on the problem. I'm going to use wolfies' substitution of the conventional x and y for my earlier used f and k. Basically, what we are after is the expected value of x over a ...


2

Now in V10 we have ImplicitRegion and RegionCentroid to do this easily: reg = ImplicitRegion[y > 0 && y <= 1 - x^2/4, {x, y}]; Then: RegionCentroid[reg] {0, 2/5}


0

In Mathematica 10, this can be easily computed using built-in functionality. Using Silvia's answer's polygon and function: polygonPts3D = { {-0.902757, -0.116805, 0}, {0.203504, -0.972294, 0}, {0.849893, 0.414192, 0}, {0.374057, 0.835407, 0}, {-0.907079, 0.352119, 0} }; f[x_,y_,z_] := ...


2

This is a very nice problem. If I may dispense with the notation for random variables as $f$ and $k$, and refer to them instead as $X$ and $Y$ ... The Problem Let $X \sim Uniform(0,1)$ and $Y \sim Uniform(2,5)$ be independent random variables, with joint pdf $f(x,y) = \frac13$: f = 1/3; domain[f] = {{x, 0, 1}, {y, 2, 5}}; We seek a closed-form ...


2

I figured out a way to answer a related simpler question, which is Expectation[ f \[Conditioned] f + \[Alpha]*k > p], {f, k} \[Distributed] UniformDistribution[{{a, b}, {k1, k2}}] Mathematica has trouble with this computation, but if you realize that it is the centroid of a polygon, you can use a feature of Mathematica to get a (long) answer ...


4

The Package HypExp does exactly that. Here is the link to paper for what I believe was the last extension. After digging around a bit, the package files should be available here ( Edit freely available link) Several years ago, there has been some work on the simplification of polylogarithms into a Hopt Algebras, which simplifies the reduction of the ...


0

Vladimir, there is one simple solution: lst = Table[{a, NIntegrate[BesselJ[0, x - a] BesselJ[0,x + a], {x, -\[Infinity], \[Infinity]}, PrecisionGoal -> 5, Compiled -> True]}, {a, 0.84, 0.85, 0.0001}] This visualizes the result: ListPlot[lst, Frame -> True, FrameLabel -> {Style["a", 16], Style["Integral", 16]}, GridLines -> ...



Top 50 recent answers are included