lambda calculus – Constructing a monad via type synonyms of a particular kind

We can define a reader/environment monad on the simply-typed lambda calculus, using the following three equations, where $r$ is some fixed type, $alpha$ is any type (I subscript some terms with their types), $mathbb{M}$ is the proposed monadic type modality), $eta$ is the unit of the monad and $mu:mathbb{M} mathbb{M}alpha → mathbb{M}alpha$ is the join of the monad:

$$mathbb{M} thinspace α = r → α hspace{1cm} ∀α$$
$$ eta , a_{alpha} = lambda c_{r}.; a hspace{2cm} ∀a_{alpha}$$
$$mu,b_{mathbb{M}mathbb{M} alpha} = λc_{r}.; b_{mathbb{M}mathbb{M}alpha}, c, c hspace{1cm} ∀b_{mathbb{M}mathbb{M} alpha} $$

Can we always construct a reader monad by type synonyms of the form $r = x$, for arbitrary function types $x$ (for example, where $x$ is $(beta to t) to t$), for some type $beta$?

multivariable calculus – Proof of the Formula for Linear Approximation With $n$ Variables?

The linear approximation of $f(vec{x})$ where $vec{x}$ has $n$ elements is given by $$f(vec{x}) approx f(vec{a}) + sum_{j=1}^n frac{partial f}{partial x_j} (vec{a})(x_j-a_j)$$ for $vec{a}$ near $vec{x}$. I understand this formula, but don’t understand the proof. Can someone please explain this to me?

calculus and analysis – How to get the Taylor series of implicit functions

Given that the equation $x+frac{1}{2} y^{2} +frac{1}{2} z+sin (z)=0$ can determine an implicit function $z(x,y)$ at {0, 0}, I now need to expand the implicit function $z(x,y)$ to a fourth-order Taylor series at {0, 0}. How can I do it?

x + 1/2 y^2 + 1/2 z(x, y) + Sin(z(x, y)) == 0

calculus and analysis – How to quickly calculate the limit of integral with parameters

I want to quickly calculate the limit value of $lim _{x rightarrow 0} frac{int_{0}^{x} t ln (1+t sin t) d t}{1-cos x^{2}}$.

But using the code below I need to take 40 seconds to get the result:

Limit(Integrate(t*Log(1 + t*Sin(t)), {t, 0, x})/(1 - Cos(x^2)), 
 x -> 0)

I get an error message if I use the numerical method to solve:

 Integrate(t*Log(1 + t*Sin(t)), {t, 0, x})/(1 - Cos(x^2)), x -> 0)

What should I do to get the correct limit value quickly?

calculus – Change of Variables Theorem with Inverted transformation

The change of variable theorem states

Given open sets $U$ and $V$ in $mathbb{R}^n$, let $G: U rightarrow V$ be a one-to-one transformation of $C^1$ class whose derivative $DG(u)$ is invertible for all $u in U$. Suppose that $T subset U$ and $S subset V$ are measurable sets such that $G(T)=s$. If $f$ is an integrable function on $S$ then $f circ G$ is integrable on T, and:

$int_S f(x) d^nx = int_T f(G(u)) |det DG(u)| d^nu$.

Is there a equivalent formulation of the above theorem but for the transformation in reverse?
In other words, if I am given $G^{-1}$, but $G$ is tedious to calculate, is there a formulation where I can proceed directly with $G^{-1}$? I vaguely recall something with $|det DG(u)|^{-1}$ in it.

calculus – integral of (x^5+1)cos(x) on a symmetric interval

I gave my Calc II class the following problem on their first assignment of the quarter:

$int_{-frac{pi}{2}}^{frac{pi}{2}} (x^5+1)cos x : dx$,

which evaluates to 2 when one takes into account that the odd part ($x^5cos x $) evaluates to zero on a symmetric interval — something we covered a few lessons in.

I naively thought that no one would bother integrating by parts since we had not yet covered that technique in class (and it’s tedious to do even if one knows how), but of course several students did. More interestingly, I had a handful of students submit something that looks like

int_{-frac{pi}{2}}^{frac{pi}{2}} (x^5+1)cos x : dx &= int_{-frac{pi}{2}}^{frac{pi}{2}} frac{x^{10}-1}{x^5-1} cos x : dx \&= int_{-frac{pi}{2}}^{1} frac{x^{10}-1}{x^5-1} cos x : dx + int_{1}^{frac{pi}{2}} frac{x^{10}-1}{x^5-1} cos x : dx \
&= (102 sin(1) -60pi -frac{pi^5}{32} + frac{5 pi^3}{2} + 65 cos(1) + 1) + \ &~~~~~~(-102 sin(1) +60pi +frac{pi^5}{32} – frac{5 pi^3}{2} – 65 cos(1) + 1) \
&= 2

This did not earn them much credit since there is a lot of work missing between steps 2 and 3, and to be honest I suspect this solution may have been spit out by some kind of integration software (though every one I have checked just does integration by parts). Ordinarily I would write this off as a student doing something weird, but the fact that several submitted the same method (possibly from the same source) has piqued my curiosity — is there an actual useful technique being applied here? Rewriting the expression in this way and then splitting the integral at the (artificially created) singularity does not seem particularly helpful to me.

calculus and analysis – Analytic continuation of Riemann Zeta Prime Function

I want to plot the real part of Riemann Prime Zeta function over the imaginary axis. This should be do-able since the Riemann Prime Zeta function has an analytic continuation up to the imaginary axis ( However, Mathematica doesn’t seem to know about it.

Plot(Re(PrimeZetaP(I x)), {x, 0, 10}) 

Just gives an empty plot, and

x = 1
Re(PrimeZetaP(I x))
x =.

Doesn’t evaluate.

Is there some trick, or the explicit form of the analytic continuation? I can’t find it.

calculus and analysis – Why doesn’t Mathematica ComplexExpand integrals?

Consider this code example:

ComplexExpand(Re(Integrate(f(t), {t, a, b})))

Mathematica gives me the result as

Re(Integrate(f(t), {t, a, b}))

which is obviously not helpful and not what should happen in my understanding. If all variables are real – and that’s what ComplexExpand assumes according to the documentation – then Re can be dropped from the expression. The same happens for Im. This seems to confuse FullSimplify which leaves me with a long expression that could be shorted. Why is this the case? How can I get Integrate (and Re) to evaluate properly to simply

Integrate(f(t), {t, a, b})

functional programming – Lambda Calculus Conversion

How can I take a data type or function (eg fold, list, String, zip) and convert it to a lambda calculus expression (or how can it be expressed as a lambda expression)?
If sum computes a sum of all elements in a list and :t sum -> Num a => (a) -> a. How do I take this information to translate it to a lambda calculus expression?
I have tried to find guides online but they just give me the answers. I want to know how to actually make the conversion/translation from a function to a lambda calculus expression.


calculus – Finding the function that satisfies to condition that the length of the curve is the same as the volume of ratation around the x-axis

I want to find the function that satisfies the following DE:

$$pi y(x)^2=sqrt{1+(y'(x))^2}$$

This comes from the fact that the left-hand side gives the volume of radiation around the x-axis and the right-hand side gives the length of the curve. I also know that the initial condition is given by $y(a)=b$ where $a$ and $b$ are real values.

The questions I have are:

  1. What is the function $y(x)$?
  2. In what range of $x$ is the function $y(x)$ real-valued?