# Sandbox for drafts of long, complex answers

This sandbox is intended for saving drafts of long, complex answers, especially answers whose composition takes a long time. It serves to localize to one thread the front-page "bumps" caused by edits to drafts of such answers, so that they may be easily ignored. Also, it helps to guard against losing longly-composed answers due to system crashes.

When you are happy with your draft here, you may simply copy the code and paste it to the desired location.

Proper Use of the Sandbox

1. Do not post a new answer! We wish all the answers on this page to be owned by the Community user (so that only a non-sentient bot is informed of edits to these answers). Posting a new answer will make you the owner, meaning that you will be notified whenever another user makes an edit to that answer.
2. Do not delete answers! Deleting seems like a reasonable option, but there are no "hard deletions" on Stack Exchange, and users will sufficient privileges will still see your supposedly deleted postings.
3. Do look for an answer which indicates that it is free and then edit it to your heart's content. If none looks available, take over the one that has been left unchanged the longest (which will appear at the bottom of the page if you order answers by "activity").
4. Do clear your draft when you are finished. This includes removing all $\LaTeX$ from your answers. Replacing all code with a simple statement like
This answer is free for anyone to use
is sufficient. Periodically users may go through and free up answer slots that have not been edited in, say, over one month. But you can aid in the smooth running of this sandbox by clearing away your drafts when you are finished with them.
5. Do not create new such sandboxes. The point of having a unique such sandbox is that it minimizes the noise on the front page when the sandbox is edited. If there were multiple sandboxes they will frequently occupy numerous front page slots, pushing other topics off the front page, and increasing noise.
-
I have added a [sandbox] tag to allow people ignore it more easily (via software support of ignoring tags), and since it seems that we have two sandboxes now, a tag may seem a bit more in place here. –  Asaf Karagila Jul 18 '12 at 8:35
+1, great idea! It might be preferable if moderators delete "free for use" posts from time to time. You don't want two users writing their extensive, carefully crafted answers as edits of the same post and overwrite each other. Also, Chrome crashes from time to time. For some reason, I don't lose what I've written in an original post, but lose it when editing. So if I would use this thread, I would still prefer to create a new post. –  Michael Greinecker Jul 18 '12 at 11:06
@MichaelGreinecker, since deleted answers are still visible for 10k+ users, they would just accumulate in a useless state if they were deleted rather than reused. Also, if you prefer working in a pristine post rather than saving-and-then-editing (such as due to the autosave), then this sandbox is probably not for you anyway. You could do that just as easily at the eventual location of your post. –  Henning Makholm Jul 18 '12 at 11:13
(+1) For thinking outside the (sand)box. –  cardinal Jul 18 '12 at 19:40
My own practice for sandboxes is to post a stub question and then delete it immediately. If you don't leave the page, you can continue to edit the deleted question, and then undelete it when you are finished. –  MJD Jul 23 '12 at 18:14
I have discovered a drawback of the method I described in the previous comment: moderators might choose to undelete your sandbox without consulting you. If you do use this method, it is probably a good idea to attach a header that says draft in large letters. –  MJD Jul 24 '12 at 13:40
I must say I am somewhat curious to why there are up/down-votes on the sandbox answers... –  Willie Wong Jul 24 '12 at 13:44
@Mark Please don't delete any answers in this sandbox. Deleted answers are displayed to users with 10k+ rep. If every answer was deleted when done, then the thread would eventually have hundreds of deleted answers, which would make page navigation and MathJax rendering very complex for 10k+ users. That is why I advocated reuse of answers. –  anon Jul 24 '12 at 14:14
@Willie My guess would be that they are used to keep the answers sorted (so that they are not permuted randomly and user who edited one of the answers finds it in the same place when it returns). Perhaps it is slightly more comfortable that way. –  Martin Sleziak Aug 6 '12 at 8:37
I find the sandbox is too slow to edit a long answer. –  Makoto Kato Aug 26 '12 at 0:37
@Makoto MathJax can get very slow when rendering long answers. I don't think the sandbox plays any role in what you see, since there is no other TeX code on the page. –  anon Aug 26 '12 at 2:15
@MakotoKato, unfortunately, you have chosen the worst possible browser to use. IE8 is slower than all other browsers (e.g., IE9 and IE7 are twice as fast, chrome is 5 times as fast for MathJax). Switching browsers would give you an immediate performance improvement. Short of that, the incremental preview that I link to above would help you a lot as well. I will look into it more, but IE8 has such poor performance, I doubt I can do much to help. Do you shut down your browser between uses, or is it running all the time? –  Davide Cervone Aug 29 '12 at 10:33
I just did some timing tests, and here are the results. Editing Makoto's post (with over 400 equations), to retypeset the entire page: in IE8, 2 minutes 25 seconds, in IE9, 12 seconds, in Safari 5, 10 seconds, in Firefox 15, 13 seconds. So you see that IE8 is really a bad choice or this type of work. The reason it is so bad is that any time MathJax asks for the size of some piece of mathematics (so it can place the superscripts properly, etc), IE reflows the entire page, and that slows things down considerably... –  Davide Cervone Aug 29 '12 at 11:18
At the suggestion of the moderators, I have gone and changed the associated owners of all the answers here to the Community user. This way, the original owners will not receive excess pings for each time another user uses the draft space for their work. Enjoy! –  Grace Note Oct 5 '12 at 14:45
To prevent crashes I've found the "Bookmarks to disable/enable MathJax", provided in here, pretty useful. –  leo Dec 17 '12 at 18:03

Clairuts' Equation - FREE

$\displaystyle\left(x\dfrac{\mathrm dy}{\mathrm dx}-y\right)^2=a\left(1+\left(\dfrac{\mathrm dy}{\mathrm dx}\right)^2\right)(x^2+y^2)^{3/2}$

$\displaystyle \begin{cases}x=\rho \cos(\theta) \\ y=\rho \sin(\theta)\end{cases}\,\to\,\begin{cases}\mathrm dx=\mathrm d\rho\cos(\theta)-\rho\sin(\theta)\mathrm d\theta \\ \mathrm dy=\mathrm d\rho\sin(\theta)+\rho\cos(\theta)\mathrm d\theta\end{cases}$

$\dfrac{\mathrm dy}{\mathrm dx}=\dfrac{\dfrac{\mathrm d\rho}{\mathrm d\theta}\sin(\theta)+\rho\cos(\theta)}{\dfrac{\mathrm d\rho}{\mathrm d\theta}\cos(\theta)-\rho\sin(\theta)}$

$\displaystyle\left( \rho \cos(\theta) \dfrac{\dfrac{\mathrm d\rho}{\mathrm d\theta}\sin(\theta)+\rho\cos(\theta)}{\dfrac{\mathrm d\rho}{\mathrm d\theta}\cos(\theta)-\rho\sin(\theta)}-\rho\sin(\theta) \right)^2=a\left[1+\left(\dfrac{\dfrac{\mathrm d\rho}{\mathrm d\theta}\sin(\theta)+\rho\cos(\theta)}{\dfrac{\mathrm d\rho}{\mathrm d\theta}\cos(\theta)-\rho\sin(\theta)}\right)^2\right]\rho^3$

$\left(\rho\cos(\theta)\left(\dfrac{\mathrm d\rho}{\mathrm d\theta}\sin(\theta)+\rho\cos(\theta)\right)-\rho\sin(\theta)\left(\dfrac{\mathrm d\rho}{\mathrm d\theta}\cos(\theta)-\rho\sin(\theta)\right)\right)^2 \\\,\\ \qquad\quad=a\left[\left(\dfrac{\mathrm d\rho}{\mathrm d\theta}\cos(\theta)-\rho\sin(\theta)\right)^2+\left(\dfrac{\mathrm d\rho}{\mathrm d\theta}\sin(\theta)+\rho\cos(\theta)\right)^2\right]\rho^3$

-

image 1 image 2 image 3

Proof. We use the standard geometric argument presented, for example, in [155]. Namely, let us introduce a mapping $$\phi:\mathbb R\times\mathbb R\to\mathbb R$$ defined by $$\phi(x,y)=x+y\quad(x\in\mathbb R,y\in\mathbb R).$$ This mapping can be described in another way. Denoting $$l=\{(x,y)\in\mathbb R\times\mathbb R\colon x+y=0\},$$ we see that $\phi$ is identical with the projection $$pr_l\colon\mathbb R\times\mathbb R\to\mathbb R\times\{0\}$$ whose direction is determined by the straight line $l$. Now, from the geometric viewpoint it is almost evident that

-

$$\sum_{k=0}^c \binom{r+2}{k}\cdot(1+c-k) =(1+c)\cdot \sum_{k=0}^c \binom{r+2}{k}-\sum_{k=0}^c \binom{r+2}{k}\cdot k$$

Test definitions: $$%% complex amplitude of E and H \def\caE{{\underline{\hat{E}}}} \def\caH{{\underline{\hat{H}}}} \def\caB{{\underline{\hat{B}}}} \def\rot{{\operatorname{rot}}} \rot\caE = -j\omega \caB$$ Can we use these definitions throughout the page? $$\caB = \mu_0 \caH$$ It works!

-

This answer is free for anyone to use

-

This answer is free for everyone.

-

$\quad$We should say some more careful words

-

$$C_1 : \prod_{A:\mathsf{Bird}} \prod_{B:\mathsf{Bird}} \sum_{C:\mathsf{Bird}} \prod_{x:\mathsf{Bird}} Cx=A(Bx)$$

$$\mathsf{mockingbird}:\mathsf{Bird} \rightarrow \mathcal{U} \\ \mathsf{mockingbird}(m) :\equiv \prod_{x:\mathsf{Bird}}{mx=xx}$$

$$C_2 : \sum_{M:\mathsf{Bird}}\mathsf{mockingbird}(M)$$

$$(\ \_\ \mathsf{isFondOf}\ \_\ ) : \mathsf{Bird} \rightarrow \mathsf{Bird} \rightarrow \mathcal{U} \\ X\ \mathsf{isFondOf}\ Y :\equiv XY = Y$$

$$\mathsf{Exercise1} : \prod_{A:\mathsf{Bird}} \sum_{B:\mathsf{Bird}} A\ \mathsf{isFondOf}\ B$$

$$\mathsf{Exercise1} : \prod_{\left(C_1 : \prod_{A:\mathsf{Bird}} \prod_{B:\mathsf{Bird}} \sum_{C:\mathsf{Bird}} \prod_{x:\mathsf{Bird}} Cx=A(Bx)\right)} \prod_{\left(C_2 : \sum_{M:\mathsf{Bird}}\mathsf{mockingbird}(M)\right)} \prod_{\left(A:\mathsf{Bird}\right)} \sum_{\left(B:\mathsf{Bird}\right)} A\ \mathsf{isFondOf}\ B \\ \mathsf{Exercise1}(C_1, C_2, A) :\equiv \left(\left(\ldots\right) : \sum_{B:\mathsf{Bird}}A\ \mathsf{isFondOf}\ B\right) \\ \mathsf{Exercise1}(C_1, C_2, A) :\equiv \mathbf{let}\ M :\equiv \mathsf{pr_1}(C_2) \ \mathbf{in} \\ dots$$

-

This answer is free for anyone to use

-
for future reference, do not delete answers on the sandbox thread. When you are done with the answer, just click "edit" and replace what you have written by the phrase "This answer is free for anyone to use" –  Willie Wong Jan 31 at 8:54

An answer to this needs editing.

-

This answer is free for anyone to use.

-

6. For the primefactor 2

The multiplicity of the primefactor 2 in $f(n)$ follows that equation:
$$\{f(n),2 \} = 1 + 2*[n:2] + \{n,2\}$$ such that we have for $g(n)$ $$\begin{eqnarray} \{g(n),2\} &=& \{f(2n),2\} - \{f(n),2\} \\ &=& (1 + 2 \cdot [2n:2] + \{2n,2\}) - ((1 + 2 \cdot [n:2] + \{n,2\})) \\ &=& 1 + 2 + 1+\{n,2\} - 1 - 2 \cdot [n:2] - \{n,2\} \\ &=& 1+ 2 \cdot (1-[n:2]) \\ \{g(m-1),2\} &=& 1+ 2 \cdot (1-[m-1:2]) \\ &=& 1+ 2 \cdot [m:2] \\ \end{eqnarray}$$ This means, for odd $m$ we have $\{g(m-1),2 \} = 1$ and for even $m$ with $m =2^a \cdot \mu$ we have $\{g(m-1),2 \} = 3$.

Thus for to have $m | g(m-1)$ we can have $m=2^3 = 8$. But now the OP is more restrictive - it requires $m(m-2) | g(m-1)$ and thus $m$ can only equal $m=2^2=4$ and $$m(m-2)=2^2 \cdot 2^1 = 2^3 | g(m-1)$$
Because in section 5 I proved that we cannot have an odd primefactor in $m$ this is the only solution and the only solution in terms of $n$ is

• $n=3$ is the only solution for $n^2-1 | g(n)$
-

This answer is currently being used to draft a Mathjaxification of Alan's answer to Evaluating the Integral: $\int_0^\infty \frac{( \frac{1}{2} - \cos x )}{x} dx$. All are welcome to assist.

### The partial translation

$$\int_0^{+\infty}\left(\frac 1 2 - \cos x\right)\frac {dx} x = \gamma$$

\begin{align*}\int_{1/n}^n \left(\frac 1 2 - \cos x\right)\frac {dx} x &= \int_{1/n}^1 \left(1 - \cos x\right)\frac {dx} x -\int_1^n \cos x\frac {dx} x+ \frac 1 2 \left(\int_1^n \frac {dx} x -\int_{1/n}^1 \frac {dx} x\right) \\ &=\int_{1/n}^1 (1-\cos x) \frac {dx} x - \int_1^n \cos x \frac {dx} x \end{align*} $$\bbox[0.2ex,border:0.5pt solid black]{\int_0^1 \frac {1-\cos(y)}y\,dy -\int_1^{+\infty} \frac {\cos(y)} y\,dy=\gamma}$$

Here is the proof of Gronwall, 1918. For $n$ a positive integer \begin{align} A(n) &= \int_0^{n\pi} \frac{1-\cos (y)}{y} dy - \ln ( n\pi ) \\ &= \int_0^1 \frac{1-\cos (y)}{y} dy + \int_1^{n\pi} \frac{1-\cos (y)}{y} dy - \ln ( n\pi ) \\ &= \int_0^1 \frac{1-\cos(y)}{t} dy - \int_1^{n\pi} \frac{\cos(y)}{y} dy \end{align}

With a change of variable $x = 2 \pi ny$:

\begin{align} \int_0^{n\pi} \frac{1-\cos(x)}{x} xy &= \int_0^{\frac{1}{2}} \frac{1 - \cos (2\pi ny)}{y} dy \\ &= \pi \int_0^{\frac{1}{2}} \frac{1 - \cos (2 \pi ny)}{\sin(\pi y)} dy + \int_0^{\frac{1}{2}} g(y) dy - \int_0^{\frac{1}{2}} g(y) \cos ( 2 \pi ny) dy \end{align}

$g(y) = \frac{1}{y} - \frac{\pi}{\sin (\pi y)}$ which is continuous on $[0,\frac{1}{2}]$ with $g(0) = 0$.

With Riemann-Lebesgue theorem $$\int_0^\frac{1}{2} g(y) \cos ( 2 \pi n y ) dy \rightarrow 0 \text{ for } n \rightarrow + \infty$$

\begin{align} \int_0^\frac12 g(y) dy &= \lim_{s \to 0^+} \int_s^\frac12 \left( \frac 1y - \frac \pi{\sin(\pi y)} \right) dy \\ &= \lim_{s \to 0^+} \left[ \ln \left( \frac{y}{\tan ( \pi/2\;y )} \right) \right]_s^{\frac{1}{2}} = \ln ( \pi ) - 2 \ln (2) \end{align}

On the other hand \begin{align} \pi \int_{0}^{\frac{1}{2}} \frac{1 - \cos ( 2 \pi n y)}{\sin ( \pi y )} dy &= 2\pi \int_{0}^{\frac{1}{2}} \sum_{k=1}^{n} \sin ( (2k-1) \pi y ) dy \\ &= \sum_{k=1}^{n} \frac{2}{2k-1} = \ln (n) + 2 \ln (2) + \gamma + o(1) \end{align}

Finally $$A(n) = \gamma + o(1)$$

Thanks very much to Sladjan Stankovik for providing insight into this problem for me.

-

Started to work on this answer on Feb 7th 2014; hopefully going to be an answer to Polynomial map is surjective if it is injective.


Lemma. Let $A$ be a finitely generated $\ZZ$-subalgebra of some $\QQ$-algebra. Then for all but finitely many primes $p \in \ZZ$, there is a maximal ideal $\mm_p\subset A$ such that $A/\mm_p$ is a finite field.

Proof. Write $A = \ZZ[a_1, \dots, a_n]$. The proof is by induction on $n$. The case $n = 0$ is trivial, so assume that $n \geq 1$. If $a_1, \dots, a_n$ are algebraically independent over $\QQ$, then for each prime $p$, the ideal $\mm_p = (p, a_1, \dots, a_n)$ works. So, additionally assume that the $a_1, \dots, a_n$ are algebraically dependent, say $f \in \ZZ[X_1,\dots,X_n]$ is a non-zero polynomial such that $f(a_1, \dots, a_n) = 0$. Without loss of generality, we can assume that $X_n$ actually occurs in $f$ and, changing the generators if needed by a polynomial transformation, that $f$ is of the form $$f = c X_n^m + f_{m-1}(X_1,\dots,X_{m-1}) X_n^{m-1} + \dots + f_0(X_1,\dots,X_{m-1}),$$ where $0 \neq c \in \ZZ$ and $f_0, \dots, f_{m-1} \in \ZZ[X_1,\dots,X_{m-1}]$. Write $B = \ZZ[a_1,\dots,a_{n-1}]$.

and note that $ra_n$ is integral over $B$.

By induction hypothesis there is a finite set $E_1 \subseteq \ZZ$ of primes such that for all primes $p \not\in E_1$ there is a maximal ideal $\nn_p \subset B$ containing $p$ such that $B/\nn_p$ is a finite field. Let $E_2$ be the set of prime divisors of $r$ and define $E = E_1 \cup E_2$.

-

Notation Let $A$ be a commutative ring with unity. Let $I$ be an ideal of $A$. Let $f$ be an element of $A$. We denote by $I_{(f)}$ the inverse image of $IA_f$ by the canonical homomorphism $A \rightarrow A_f$. Namely $I_{(f)} = \{x \in A | \$ There exists an integer $n \gt 0$ such that $f^n x \in I \}$.

Let $\mathcal{I}$ be a nonempty collection of ideals of $A$. We denote by $\mathcal{I}_{(f)}$ the set $\{I_{(f)}\ | \ I \in \mathcal{I} \}$.

Lemma 1 Let $A$ be a commutative ring with unity. Let $f$ be an element of $A$. Let $\mathcal{I}$ be a nonempty collection of ideals of $A$. Let $J$ be an element of $\mathcal{I}$. Suppose $JA_f$ is maximal in the set $\{IA_f \ |\ I \in \mathcal{I} \}$. Then $J_{(f)}$ is maximal in $\mathcal{I}_{(f)}$.

Proof: Let $I$ be an element of $\mathcal{I}$ such that $J_{(f)} \subset I_{(f)}$. Then $J_{(f)}A_f \subset I_{(f)}A_f$. Hence $JA_f \subset IA_f$. By the assumption, $JA_f = IA_f$. Hence $J_{(f)} = I_{(f)}$. QED

Lemma 2 Let $A$ be a commutative ring with unity. Let $f_1,\cdots, f_n$ be elements of $A$ such that $A = (f_1,\cdots, f_n)$. Let $I, J$ be ideals of $A$ such that $I \subset J$. Suppose $I_{(f_i)} = J_{(f_i)}$ for all $i$. Then $I = J$.

Proof: Let $x \in J$. It suffices to prove that $x \in I$. Since $J \subset J_{(f_i)}$ for all $i$, $J \subset I_{(f_i)}$ for all $i$, Hence there exists an integer $m \gt 0$ such that $f_i^m x \in I$ for all $i$. By this question, we can prove without the axiom of choice that $A = (f_1^m,\cdots, f_n^m)$. Hence there exists $g_1,\cdots, g_n \in A$ such that $1 = g_1f_1^m + \cdots + g_n f_n^m$. Then $x = g_1f_1^m x + \cdots + g_n f_n^m x \in I$ as desired. QED

Proof of the theorem We define inductively sets of nonempty ideals $\mathcal{I}_0, \mathcal{I}_1, \cdots, \mathcal{I}_n$ and ideals $J_1, \cdots, J_n$ as follows. We define $\mathcal{I}_0 = \mathcal{I}$. Let $k$ be an integer such that $1 \le k \le n$. Suppose $\mathcal{I}_{k-1}$ is defined. Let $J_k$ be an element of $\mathcal{I}_{k-1}$ such that ${J_k}_{(f_k)}$ is a maximal element of $\mathcal{I_{k-1}}_{(f_k)}$ which exists by Lemma 1. We define $\mathcal{I}_k = \{I \in \mathcal{I}_{k-1} \ |\ I_{(f_k)} = {J_k}_{(f_k)}\}$. We claim that $J_n$ is a maximal element of $\mathcal{I}$. Let $I \in \mathcal{I}$ be such that $J_n \subset I$.

We first show by induction that $I \in \mathcal{I}_k$ for $k = 0, 1, \cdots, n$. Since $\mathcal{I}_0 = \mathcal{I}$, $I \in \mathcal{I}_0$. Let $k$ be an integer such that $1 \le k \le n$. Suppose $I \in \mathcal{I}_{k-1}$. Since $J_n \in \mathcal{I}_k$, ${J_n}_{(f_k)} = {J_k}_{(f_k)}$. Since ${J_n}_{(f_k)} \subset I_{(f_k)}$, ${J_k}_{(f_k)} \subset I_{(f_k)}$. Since $I \in \mathcal{I}_{k-1}$, ${J_k}_{(f_k)} = I_{(f_k)}$. Hence $I \in \mathcal{I}_k$ as desired.

Next we prove that ${J_n}_{(f_k)} = I_{(f_k)}$ for all $k$. Since $J_n \in \mathcal{I}_k$, ${J_n}_{(f_k)} = {J_k}_{(f_k)}$. On the other hand, since $I \in \mathcal{I}_k$, ${J_k}_{(f_k)} = I_{(f_k)}$. Hence ${J_n}_{(f_k)} = I_{(f_k)}$ as desired.

By Lemma 2, $J_n = I$. Hence $J_n$ is a maximal element of $\mathcal{I}$. QED

-