Wikipedia:Reference desk/Archives/Mathematics/2009 March 1

= March 1 =

LaTeX question
Hello, I type lots of things with LaTeX, mostly homework and notes. I recently made a separate file with many of my own commands/shortcuts. But, since I have a separate folder for each class, I have to put my shortcut file in every folder. Then, if I want to make a change, I have to change one and then copy and paste to a few other folders. So, is it possible to do this a better way? Is it possible, for example, to put my shortcut file in the same directory as things such as the amsmath file I can invoke with \usepackage, so that I can just do \usepackage{MyShortcuts} or something like that?

Thanks, any help would be much appreciated. Also, of course this is not a math question but I thought this would be the best place to put this as mathematicians/scientists are the most likely to use LaTeX and be proficient. StatisticsMan (talk) 01:25, 1 March 2009 (UTC)
 * Where tex looks for files varies based on the actual software you are using. On unix like systems (linux, Mac OS X) you can put the files in a directory "texmf" in your home directory, but you need to run a command like "texhash" or "mktexlsr" to let tex know about them.  For miktex, there is something similar, but you would have to read the documentation.  Just putting your file with the others won't be sufficient, you have to have it "rehash" or look again at what files it has.  I think you have to do this whenever you install a new package in miktex, say from CTAN. JackSchmidt (talk) 02:25, 1 March 2009 (UTC)


 * I found using the texmf directory stucture rather confusing, so I have a bash script which takes a given file, copies it to a fixed temporary directory, copies my personal style file to that temporary directory, compiles the file, and copies the result back to the starting location. Although this isn't a very nice solution (and causes a bit of a mess when you include images in your document) it's less of a learning curve and easier to do then the "right" way.  As an added bonus I don't have a ton of ".log" and ".aux" files scattered everywhere -- those stay in my temporary directory.  Eric.  131.215.158.184 (talk) 08:45, 1 March 2009 (UTC)
 * Instead of maintaining separate copies of your macro file, you can keep one copy and use symbolic links in the other locations. This works great on unix-like systems (including Mac OS X). Not sure about Windows. Staecker (talk) 13:35, 1 March 2009 (UTC)


 * Use the TEXINPUTS environment variable to specify a path to search. In modern implementations of latex it understands a trailing "//" to mean recursive search of that directory. &mdash; Charles Stewart (talk) 14:04, 1 March 2009 (UTC)

Equality of some differentiated inner products
I'm trying to work through the details of lemma 16.1 in this book, and have gotten stuck on the following:


 * Finally, taking the inner product in (16.15) with $$t^2 A^2 u(t)$$, we obtain
 * $$\frac{1}{2} \frac{d}{dt} (t^2 \| Au(t) \|^2) + t^2(A^2 u(t), A u(t)) = t \|A u(t)\|^2,$$ (...)

Here (16.15) is a generalized version of the heat equation, $$\dot u(t) + A u(t) = 0$$. A is a linear transformation satisfying $$(Aw,v) = (w,Av)$$ and $$(Av,v) \ge 0$$ for any v, w. (The inner products are done over the space domain; the dependence of u on a space variable is implicit.)

Following the hint,


 * $$(t^2 A^2 u(t), \dot u(t)) + (t^2 A^2 u(t), A u(t)) = 0$$


 * $$t^2 (A^2 u(t), \dot u(t)) + t^2 (A^2 u(t), A u(t)) = 0$$

and so to reach the desired result it must be that


 * $$t^2 (A^2 u(t), \dot u(t)) = \frac{1}{2} \frac{d}{dt} (t^2 \| Au(t) \|^2) - t \|A u(t)\|^2.$$

Why is this equation true / how do I derive this? (Or am I making an error somewhere?) Fredrik Johansson 22:47, 1 March 2009 (UTC)
 * Just compute
 * $$\frac{d}{dt} (t^2 \| Au(t) \|^2)=  2t\| Au(t) \|^2+ t^2 \frac{d}{dt}\| Au(t) \|^2$$
 * $$=2t\| Au(t) \|^2+ t^2 \frac{d}{dt}(Au(t),Au(t))=2t\| Au(t) \|^2+ 2t^2(Au(t),A\dot u(t))=2t\| Au(t) \|^2+ 2t^2(A^2 u(t),\dot u(t)).

$$--pma (talk) 00:03, 2 March 2009 (UTC)


 * Thank you! I had the idea, but got stuck somewhere... Fredrik Johansson 00:19, 2 March 2009 (UTC)

Infinity Norm of A Fourier Series
Hi, I was wondering how to compute the infinity norm of a finite Fourier series with the function its approximating.

My starting point is: $$||f(x) - F_{20}(x)|| = max_{x \in [-2\pi,2\pi]} |f(x) - F_{20}(x)|, $$

From looking at the graph of the two functions together, it is pretty obvious the maximum lies at the ends of the interval but i don't know how to prove it.

The function i am approximating is $$ f(x) = x^{2} $$, and my approximation is $$F_{N}(x) = \Sigma_{k=1}^{N} \frac{4}{k} (-1)^{k} cos(kx) $$

The Fourier series is 2$$\pi$$ periodic, so the graphs disperse at $$\pi$$ and $$-\pi$$, the Fourier series continuing periodicly and the $$x^{2}$$ graph increasing quickly. So in the [$$-\pi,\pi$$] interval the difference is very small, but outside of this it grows so i'm guessing the greatest point is on the edge of the [$$-2\pi,2\pi$$] interval. (The edge of the interval also happens to be very close to a minimum of the Fourier series, if not the minimum.)

Any help is greatly appreciated. Thanks —Preceding unsigned comment added by 82.32.212.250 (talk) 23:35, 1 March 2009 (UTC)


 * Anyone? (Sorry about not signing)
 * 144.173.6.74 (talk) 15:04, 2 March 2009 (UTC)


 * So you are intersted in $$\scriptstyle d_N:=\max_{x \in [-2\pi,2\pi]} |f(x) - F_N(x)|$$, that is, the uniform distance on the interval [-2π,2π], where $$\scriptstyle f(x)=x^2$$, is it so? By the uniform convergence you have immediately that $$\scriptstyle d_N=(2\pi)^2+o(1)$$, and that $$d_N$$ is attained in a point $$\scriptstyle x_N=2\pi+o(1)$$, as $$\scriptstyle N\to\infty$$. The stronger statement that $$\scriptstyle d_N$$ is eventually attained at $$\scriptstyle 2\pi$$, shall follow proving  for instance that $$\scriptstyle F^{\prime}_N$$ converges  to $$\scriptstyle f'(x)=2x$$ uniformly in a nbd of $$0$$ (therefore, by periodicity, to $$\scriptstyle 2(x-2\pi)$$ uniformly in a nbd of $$\scriptstyle 2\pi$$). Indeed, this implies that there exists a left nbd $$\scriptstyle J$$ of $$\scriptstyle 2\pi$$ such that it eventually holds true that $$\scriptstyle x^2-F_N(x)$$ has positive derivative for $$\scriptstyle x\in J$$, so it is increasing there. This implies that $$\scriptstyle x_N=2\pi$$ as soon as $$\scriptstyle x_N\in J$$: and we do know that the latter eventually holds true. Is it clear? Then, should you need it, you can make everything quantitative and compute an $$\scriptstyle N_0$$ such that $$\scriptstyle d_N$$ is attained at $$2\pi$$ for all $$\scriptstyle N\geq N_0$$. Warning: your $$F_N$$ lacks the $$\scriptstyle\frac{a_0}{2}$$ term, and $$\scriptstyle\frac{1}{k}$$ should be squared.
 * Just for completeness: showing that $$\scriptstyle F^\prime_N(x)$$ converges uniformly for x bounded away from odd multiples of $$\pi$$. You can write
 * $$\scriptstyle F^{\prime}_N(x)=-\sum_{k=1}^N\frac{4}{k}(-1)^k\sin(kx)= -4 \Im\left(\sum_{k=1}^N\frac{(-1)^k}{k}e^{ikx}\right)$$.
 * Now, putting $$\scriptstyle z:=-e^{ix}$$, the stated convergence is just the convergence of the logarithm series $$\scriptstyle \sum_{k=1}^\infty\frac{z^k}{k}$$, which is uniform on compacta of the unit circle non containing 1. --pma (talk) 19:10, 2 March 2009 (UTC)