calculus – Differentiability of a non-continuous function

So the question that comes to my mind is does differentiability require continuity? I have read it many a times but what I think of it like this, lets say a piecewise function as below is defined
$$f(x) =begin{cases} x^2 & x leq 0 \(2ex) x^2-1 & x gt mathbb 0 end{cases}$$

Now as $xrightarrow0$ the right hand derivative approaches zero and so does the left hand derivative.
So apparently the derivative should exit at all points, even though it isn’t continuous. Am I somehow wrong here? I recently completed my school so an answer at that level would be really helpful.

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 – Show that $lim_{epsilonrightarrow0}y_epsilon(x)=delta(x)$

For $y_epsilon=frac{e^{frac{-x}{epsilon}}}{e^{frac{2}{epsilon}}}(e^{frac{2}{epsilon}}-e^{frac{2x}{epsilon}})$ prove it converges to dirac’s delta as ${epsilonrightarrow0}$.
Answer:
It is sufficient to prove $frac{1}{epsilon}lim_{epsilonrightarrow0}int_0^x y_epsilonphi(x)dx=phi(0)$, for any $phi(x)in(0,1)rightarrowmathbb{R}, phiin C_c(mathbb{R})$.
The $frac{1}{epsilon}lim_{epsilonrightarrow0}int_0^x y_epsilon dx=1$, after some calculations. Therefore I can take $frac{1}{epsilon}lim_{epsilonrightarrow0}int_0^x y_epsilon(phi(x)-phi(0))dx$.
But can I use continuity? How can I know that $lvert x-0rvert<delta$?

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

multivariable calculus – Difference between a circle inside another given polar coordinates.

I have to calculate the area between a circle of radius $r = a$ inside another one of radius $r = 2asin{theta}$

Then, I just have to setup and calculate the integrals:

$$int_0^{2pi}int_0^{r}r,dr,dtheta – int_0^{2pi}int_0^rr,dr,dtheta, $$

The author also gives the following identity:
$$sin^2theta=frac{1}{2}(1-cos2theta) $$

The second integral is easy, since $r = a$:
$$int_0^{2pi}int_0^ar,dr,dtheta = pi a^2 $$

The first integral I think it’s confusing, but it is done using $r = 2asin{theta}$:
$$int_0^{2pi}frac{r^2}{2}dtheta = int_0^{2pi}2a^2sin^2theta ,dtheta $$

Substituting using the identity:

$$int_0^{2pi}a^2(1-cos2theta) ,dtheta = 2pi a^2 + sin(4pi) = 2pi a^2$$

Finally subtracting:

$$2pi a^2 , – pi a^2 = pi a^2 $$

I’ve done just a few exercises using polar coordinates so far, there’s something wrong in the process? Since the author didn’t give any specific value for $a$, I guess it’s fine to leave the answer as it is, or is there a constant $a$ that I’m missing?

multivariable calculus – Question about Divergence formula derivation posted

As a new user, I am not allowed to comment on someone else’s answer to a question. My only choice was to ask a new question about an old answer to a question.

User @Kcronix mentioned, in this question, that the divergence of an arbitrary vector field can be derived as the net flux through the boundary of a region $R$:
$$text{net flux}=oint_{partial text{Rect}} vec{V}cdot hat{n};mathbb{d}s=int_{R} vec{V}cdot hat{n};mathbb{d}s+int_{L} vec{V}cdot hat{n};mathbb{d}s+int_{T} vec{V}cdot hat{n};mathbb{d}s+int_{B} vec{V}cdot hat{n};mathbb{d}s$$

I have tried to define the same situation in a notebook and I figured that going counter-clockwise through the sides of the rectangle would be a good idea. So it would be simply rearranged in my case:
$$text{net flux}=oint_{partial text{Rect}} vec{V}cdot hat{n};mathbb{d}s=int_{B} vec{V}cdot hat{n};mathbb{d}s+int_{R} vec{V}cdot hat{n};mathbb{d}s+int_{T} vec{V}cdot hat{n};mathbb{d}s+int_{L} vec{V}cdot hat{n};mathbb{d}s$$

Thus, I defined my top flux as:
$$int_{T} vec{V}cdot hat{n};mathbb{d}s=int_{x+Delta x}^{x} left(M(X,y+Delta y)hat
i+N(X,y+Delta y)hat jright)cdot hat j;mathbb{d}X=int_{x+Delta x}^{x}N(X,y+Delta y);mathbb{d}X$$

Please, notice how the integral goes from $x+Delta x$ to $x$, instead of going from $x$ to $x+Delta x$. This also happens to occur with the left side of the rectangle, going from $y+Delta y$ to $y$, instead of $y$ to $y+Delta y$.

This is my main question with this derivation. I know I can switch the boundaries of the integral by bringing a negative sign outside of it (from the Fundamental Theorem of Calculus), but still, I would get:
$$text{net flux}=int_{y}^{y+Delta y}M(x+Delta x,Y);mathbb{d}Y+int_{y}^{y+Delta y}M(x,Y);mathbb{d}Y\-int_{x}^{x+Delta x}N(X,y+Delta y);mathbb{d}X-int_{x}^{x+Delta x}N(X,y);mathbb{d}Xtag{1}$$
and I do not think I can reduce to the partial derivative definition with the above.

Is there anything I am missing?

calculus and analysis – Product and limit of many (>2) matrices

So I have a matrix like this

$$ begin{bmatrix} 1+iA & iAe^{-2ian/N} \
-iAe^{2ian/N} & 1-iA
end{bmatrix} $$

in mathematica form is like this

{{1 + I*A, (I*A)/E^(2*I*(na/N))}, {-(I*(A*E^(2*I*(na/N)))), 1 - I*A}}

I want to multiply these matrices from n=1 to n=N, for example if I choose N=2 I would have

{{1 + I*A, (I*A)/E^(2*I*(a/2))}, {-(I*(A*E^(2*I*(a/2)))), 1 - I*A}} . {{1 + I*A, (I*A)/E^(2*I*(2a/2))}, {-(I*(A*E^(2*I*(2a/2)))), 1 - I*A}}

Notice I put “.” not “* * ” because I want matrix product not some other thing.

After this accomplished I also would like to take the limit of this as well taking N to $infty$ for example. So I would have something like this, call above matrix $A_{n,N}$
$$ prod_{n=1}^{N}A_{n,N} $$
where product is of course matrix product.
Thanks in advance for your answers.

multivariable calculus – Building an integral when there’s a trigonometric identity

Considering the following trigonometric equality

$$sin^2{theta} = frac{1}{2}(1-cos{2theta})$$

calculate the area of the R region that is outside the circle $r = a$ and inside the circle $r = 2asin{theta}$

How should I build this integral? Since I have a $theta$ angle and the radius is in function of $theta$. Should it be a double integral of $theta$ going from $0$ to $2pi$ and the second integral for $r$? What is the role of the trigonometric equality above?

calculus – Confusion in using double integrals & projection to calculate hemispherical surface area

As a preamble, if we have a surface given by $z=z(x,y)$ in $mathbb{R}^3$, i.e. $z =z(x,y) = sqrt{a^2-x^2-y^2}$ then $z- z(x,y)=0$ gives us a constant surface of a scalar field $f$, the $grad$ of which will tell us the normal vector to our surface: $nabla f = mathbf{k} -frac{∂z}{∂x}mathbf{i}-frac{∂z}{∂y}mathbf{j}$, the norm of which is $sqrt{1+left(frac{partial z}{partial x}right)^2+left(frac{partial z}{partial y}right)^2}$

A hemisphere of radius $a$ (with the $z$ axis as the axis of symmetry) is described by the equation $x^2+y^2+z^2 (=r^2) = a^2$ and has a surface area given by

$$iint dS = iint sqrt{1+left(frac{partial z}{partial x}right)^2+left(frac{partial z}{partial y}right)^2}dA$$

If you project onto the $xy$ plane.

This formula is obtained by considering an element of surface area $mathbf{dS}$ and its projected area $mathbf{dA}$, and relating the two by $dA = cos(alpha) dS = mathbf{hat{n}}cdotmathbf{k}, dS rightarrow dS = dA/mathbf{hat{n}}cdotmathbf{k} = sqrt{1+left(frac{partial z}{partial x}right)^2+left(frac{partial z}{partial y}right)^2}dA $ using $mathbf{n}$, the normal to the surface, from the preamble and $mathbf{k}$ the unit vector in the $z$ direction.
enter image description here

For the above example we can use $z =sqrt{a^2-x^2-y^2}$ to find our partial derivatives, and then evaluate the integral using plane polar co-ordinates ($0 leq theta leq 2pi, 0 leq r leq a $) to reach an answer of $2pi a^2$ as expected.

However, if we use a normal vector to this surface expressed in 3D polar co-ordinates:
$$mathbf{hat{n}} = mathbf{r}/|mathbf{r}| = (xmathbf{i} + ymathbf{j} + zmathbf{r} )/ |mathbf{r}| = sinphi costheta mathbf{i}+sinphi sintheta mathbf{j}+cosphi mathbf{k}$$

our logic above the included diagram should still hold: $dS = dA/mathbf{hat{n}}cdotmathbf{k}$ (here projecting onto the $xy$ i.e. $r,theta$ plane).
This yields $dS = dA/cosphi$ for our 3d polar case, which has got me stuck on the next step of evaluating

$$iint dS = iint secphi dA = iint sec(phi) rdrdtheta$$

It is intuitively true that as the angle $phi$ increases, our surface area element on the hemisphere becomes more and more vertical w.r.t. the $xy$ plane and so this $1/cosphi$ makes our corresponding area element larger, but how should I actually evaluate the integral?

$iint secphi dA = iint sec(phi) rdrdtheta$ is certainly ringing alarm bells, which makes me think that projecting on the $r,theta$ plane in the first place was a mistake, which is a problem not encountered when working in 3D cartesians.

Is there such a thing as projecting onto the “$theta,phi$ plane” and then integrating over those two variables? – if this were to be a valid method I believe it could solve my problem here. Please do ask for further clarification if it is needed.

calculus and analysis – Extract real part of a complex function

I have a problem for extracting the real part of a complex number. The problem is the following: Suppose $f(z)=frac{1}{z+frac{Delta_{1}}{z+frac{Delta_{2}}{z+frac{Delta_{3}}{z+…}}}}$, in which z is a complex number $(z= a+bi)$ and $Delta_{1}$, $Delta_{2}$ … are number and $f(z)$ is a continued fraction.
And I want to compute $phi(b)$ since I would like to plot $phi(b)$ in the end

$$phi(b)=lim_{arightarrow0}Ref(a+bi)$$

But Mathematica doesn’t allow me to do that. I use “Limit” in Mathematica and set all $Delta_{n} = 0 , n > 1$ and $Delta_{1}=1$ , I get 0.
Even I let some $Delta_{n} $ to be nonzero, I still end up with 0.

Here is my code. I set $Delta_{1}=1$ and $Delta_{2}=0.5$, rest are zero.

Limit(ComplexExpand(Re(1/(a + b*I + (1/(a + b*I + (0.5/(a + b*I))))))), a -> 0)

Can someone help me with this ? I am guessing the “Limit” function in Mathematica can’t not handle this problem.

Thank you very much !!!