calculus and analysis – Why so big difference between results of Integrate and NIntegrate?

Studying an interesting article of Daniel Lichtblau, I consider a variation of an example from it, calculating an improper integral

Integrate(RealAbs(Sin(x - y))^(-2/3), {x, 0, Pi}, {y, 0, Pi})

-((12 Sqrt((Pi)) Gamma(-(1/3)) HypergeometricPFQ({1/6, 1/2, 2/3}, {7/6, 7/6}, 1))/ Gamma(1/6))

This is not very useful analytic expression, so

N(%)

16.7126

Then I compare that result with the numeric one

NIntegrate(RealAbs(Sin(x - y))^(-2/3), {x, 0, Pi}, {y, 0, Pi}, 
Exclusions -> {y == x}, AccuracyGoal -> 3, PrecisionGoal -> 3)

22.8915

The latest result is produced without any warning. How to explain so big difference between the numbers? Could this difference be decreased? Which result is more reliable?

calculus and analysis – Integration by parts

I know this question is already present in many variations, and it seems that for each one you have to define your own rules, and I am struggling to invent them in this case.

I want to integrate a big list of expressions of the form

$$
{ r^n y^{(p)} y^{(q)}},,qquad n,p,qin mathbb{Z}_{>0}
$$

where $y$ is an unknown function. Namely, by taking integrals by parts, I want to bring the expressions to the form of sum where remaining integrals contain minimal power of $r$ inside.
For example,

$$
int dr,, r^2 y’ y” = frac{1}{2} r^2 y’^2 – int dr,, r^2 y’y”-2int dr,,r y’^2
$$

Of course, straightforward application of some naive rules and then using FixedPoint will yield nothing but an infinite loop.

Probably, this is already implemented either in some package, or in some Mathematica function. I would be glad if you could point it to me.

calculus – Differentiable at $x=a$ implies continuous at $x=a$

Consider the function $$f(x)=left{begin{array}{cc} x^2-4 & text{ if }xleq 2\4x+3&text{ if } xgt 2end{array}right.$$

This function is differentiable at $x=2$ since $lim_{hto 0^{pm}}frac{f(2+h)-f(2)}{h}=4$ (EDIT: this actually isn’t true but it is true that $lim_{xto 2^-}f^prime (x)=4=lim_{xto 2^+}f^prime(x)$); however, it’s not continuous at $x=2$.

How is that possible, doesn’t differentiability at $x=a$ imply continuity at $x=a$?

This question came up when I tried to answer the question of finding $a$ and $b$ such that the function $$f(x)=left{begin{array}{cc} ax^2-b & text{ if }xleq 2\bx+3&text{ if } xgt 2end{array}right.$$

The solution is achieved by finding conditions on $a$ and $b$ such that it’s continuous, and also such that the left/right derivates exist. The left/right derivative question gives $4a=b$. With the condition of continuity you get the additional condition that $4a-b=2b+3$, giving a unique solution. But doesn’t differentiability imply continuity? What’s wrong with just solving $4a=b$ like in the first example above?

convergence divergence – Calculating Error for Taylor Series (Calculus II)

Problem:

Estimate the error if P3(X) = x – x^3/6 is used to estimate the value of sin(x) at x = 0.5

Can someone explain how I’m getting this wrong? I’m using the formula (M * |x-1|^(n+1)) / (n+1).

So far, what I understand are my variables are M = 1, n = 3, and x = 0.5. (Or at least I think so)

When I plug those in I get 0.0026042, rounded to the 7 decimals place. Any info about where I went wrong would be greatly appreciated!

calculus and analysis – How does Mathematica obtain this result?

FullSimplify(
 Sqrt(2 (Pi)) InverseFourierTransform(1/(x^2 - a^2), x, p), 
 Element(a, Reals))

Gives the output

-(((Pi) Sign(p) Sin(a p))/a)

But

$int_{-infty }^{infty } frac{e^{-i k x}}{x^2-a^2} , dx$ is not a defined integration. Mathematica also returns undefined as answer if you compute it.

So, I am trying to understand how does Mathematica calculates that Fourier transform of the non-integrable function.

calculus and analysis – Definite integral gets stuck in the calculation

$f=frac{sinh ^{-1}left(e^{-2 k t} sinh (6 k)right)}{2 k}-2$

for $k=20$ I have:

$frac{df}{dt}=-frac{e^{-20 t} sinh (60)}{sqrt{e^{-40 t} sinh ^2(60)+1}}$

f = -2 + ArcSinh(E^(-2 k t) Sinh(6 k))/(2 k)

Integrate(D(f, t), {t, 0, 10})

And he just gets stuck and doesn’t move on. Then I tried to apply parallel computation, but got the error:

Needs("Parallel`Developer`")

f = -2 + ArcSinh(E^(-2 k t) Sinh(6 k))/(2 k)

Integrate(D(f, t), {t, 0, 10})

Parallelize::nopar1: !(*SubsuperscriptBox(((Integral)), (0), (10))(*SubscriptBox(((PartialD)), (t))f (DifferentialD)t)) cannot be parallelized; proceeding with sequential evaluation.

I would be grateful for help in finding out the reason.

Processor AMD Ryzen 7 2700 Pro, 16 Gb RAM. When calculating this task, the processor is loaded by 8-10%.

calculus – Tests of independence for 2 and more samples

I need your help.
Almost every theorem from probability theory, mathematical statistics requires an independence of 2 and more random variables, also samples. There are some tests on categorical data, but I do not see such tests for samples contain numbers etc i.e. not categorical data. Please, could you provide this information about these tests, thanks a lot.