online advertising

Wednesday, January 6, 2016

UTM Ideals Varieties and Algorithm - Chapter 1 Section 3 Exercise 16

Problem:




Solution:

Yet another very long question. We will just do it step-by-step.

Part (a)

I had fun with this one, I did complete the square, compute determinant or what not, but in fact this problem is trivial, just observe all the terms are actually positive.

$ (1 - t)^2 \ge 0 $
$ 2t(1 - t)w \ge 0 $
$ t^2 \ge 0 $

Therefore the denominator is always greater than or equal to 0.

We need just a little more. Notice the first and the third term cannot be simultaneously 0, so it follows the denominator never vanishes.

For part (b), it is obvious that $ (x, y) = (x_1, y_1) $ when $ t = 0 $ and $ (x, y) = (x_3, y_3) $ when $ t = 1 $, so it follows that two points are the beginning and the end of the curve, respectively.

Part (c) is complicated. Instead of messing with the algebra and eventually get to the same result. I simply used MATLAB to automate the differentiation. Here is the code I used to differentiate:

clear;
clc;
syms x1;
syms x2;
syms x3;
syms y1;
syms y2;
syms y3;
syms w;
syms t;
d = (1 - t)^2 + 2 * t * (1 - t) * w + t^2;
x =( (1 - t)^2 * x1 + 2 * t * (1 - t) * w * x2 + t^2* x3) / d;
y =( (1 - t)^2 * y1 + 2 * t * (1 - t) * w * y2 + t^2* y3) / d;
dx = diff(x, 't');
dy = diff(y, 't');
s1 = simplify(subs(dy/dx, t, 0))
s2 = simplify(subs(dy/dx, t, 1))

So we get the derivative at the endpoints as follow:

$ \begin{eqnarray*} \frac{dy}{dx}|_{t = 0} &=& \frac{-y_2+y_1}{-x_2+x_1} \\ \frac{dy}{dx}|_{t = 1} &=& -\frac{-y_2+y_3}{x_2-x_3} \end{eqnarray*} $



Sunday, January 3, 2016

UTM Ideals Varieties and Algorithm - Chapter 1 Section 3 Exercise 15

Problem:



Solution:

Part (a) is trivial.

For part (b), the sum of the coefficients is $ ((1 - t) + t)^3 = 1 $, so it is a convex combination.

In fact, the proposition only make sense if the control polygon is convex. A general quadrilateral need not be convex, so it might not be true always.

UTM Ideals Varieties and Algorithm - Chapter 1 Section 3 Exercise 14

Problem:



Solution:

Part a is obvious. The given formula is the parametric line and by definition it is in the convex set $ C $.

Part a is the basis of the hypothesis. Consider it is true for $ n = k $, we have

$ \begin{eqnarray*} & & \sum\limits_{i=1}^{k+1} t_i \left(\begin{array}{c} x_i \\ y_i \end{array}\right) \\ &=& \sum\limits_{i=1}^{k} t_i \left(\begin{array}{c} x_i \\ y_i \end{array}\right) + t_{k+1}\left(\begin{array}{c} x_{k+1} \\ y_{k+1} \end{array}\right) \\ &=& (\sum\limits_{i=1}^{k} t_i)\sum\limits_{i=1}^{k} \frac{t_i}{\sum\limits_{i=1}^{k} t_i} \left(\begin{array}{c} x_i \\ y_i \end{array}\right) + t_{k+1}\left(\begin{array}{c} x_{k+1} \\ y_{k+1} \end{array}\right) \end{eqnarray*} $

The inner sum is actually a point in $ C $ because it is a convex combination.The outer sum is also a point in $ C $ because that is also a convex combination!

UTM Ideals Varieties and Algorithm - Chapter 1 Section 3 Exercise 13

Problem:


Solution:

The direction of the normal is $ (1, 1, -1) \times (-1, 2, 1) $. The cross product is (3, 0, 3).
Therefore the solution is $ 3x + 3z = 0 $, or simply $ x + z = 0 $.

Sturm–Liouville theory - show that the linear operator is self-adjoint.

The goal of this post is to document my derivation that the linear operator for the Sturm Liouville theory is actually self-adjoint

The differential equation is

$ \frac{d}{dx}(p(x) \frac{d}{dx}y) + (\lambda w(x) + q(x))y = 0 $

Rearranging, we can write this as an eigenvalue problem as follow:

$ \frac{d}{dx}(p \frac{d}{dx}y) + qy = -\lambda w y $

$ \frac{1}{w}(\frac{d}{dx}(p \frac{d}{dx}y) + qy) = -\lambda y $

Define the operator $ L = \frac{1}{w}(\frac{d}{dx}(p \frac{d}{dx}) + q) $, it is trivial to verify the operator is linear.

Consider the function space with inner product defined as $ <a, b> = \int a b w dx $, we wanted to verify the operator $ L $ is self-adjoint in this space, in other words, $ <As, t> = <s, At> $.

$ \begin{eqnarray*} <As, t> &=& \int \frac{1}{w}(\frac{d}{dx}(p \frac{d}{dx}s) + qs) t w dx \\ &=& \int (\frac{d}{dx}(p \frac{d}{dx}s) + qs) t dx \\ &=& \int \frac{d}{dx}(p \frac{d}{dx}s)t dx + \int qst dx \end{eqnarray*} $.

Similarly we can write the other side as

$ \begin{eqnarray*} <s, At> &=& \int \frac{1}{w}(\frac{d}{dx}(p \frac{d}{dx}t) + qt) s w dx \\ &=& \int (\frac{d}{dx}(p \frac{d}{dx}t) + qt) s dx \\ &=& \int \frac{d}{dx}(p \frac{d}{dx}t)s dx + \int qts dx \end{eqnarray*} $.

So all we needed to prove is $ \int (ps')'t dx = \int (pt')'s dx $, we do that using integration by part:

$ \begin{eqnarray*} & & \int (ps')'t dx \\ &=& \int t d(ps') dx \\ &=& ps't - \int ps' dt \\ &=& ps't - \int ps't' dx \\ &=& ps't - \int pt' ds \\ &=& ps't -pt's + \int s d(pt') \\ &=& ps't -pt's + \int (pt')' s dx \\ \end{eqnarray*} $.

So we need to show $ ps't - pt's = 0 $. This should come from the boundary conditions, which is not specified here. The boundary of a Sturm Liouville problem should satisfy this. For example, $ p(x) = 0 $ for the Legendre's problem at the boundary.

The use of a known solution to find another

Problem:

$ y'' - \frac{1}{2x}y' - \frac{1}{x^2}y = 0 $

Solution:

A good guess would be $ y = x^{k+2} $ with an unknown $ k $, the $ k + 2 $ is really just to make the algebra simpler.

$ \begin{eqnarray*} y'' - \frac{1}{2x}y' - \frac{1}{x^2}y &=& 0 \\ (k+2)(k+1)x^k - \frac{1}{2x}(k+2)(x^{k+1}) - \frac{1}{x^2}x^{k+2} &=& 0 \\ (k+2)(k+1) - \frac{k+2}{2} - 1 &=& 0 \\ 2(k+2)(k+1) - (k+2) - 2 &=& 0 \\ 2k^2 + 5k &=& 0 \\ k &=& 0 \text{ or } \frac{-5}{2} \\ \end{eqnarray*} $

So the answer is $ y = Ax^2 + \frac{B}{\sqrt{x}} $

For the sake of exercise, let's assume we do not know the second independent answer $ y = \frac{1}{\sqrt{x}} $. Can we use the answer $ y = x^2 $ to derive it?

Here is a technique for using an existing solution for another one. Assume an answer for $ y'' + p(x)y' + q(x)y = 0 $ is $ y_1(x) $, we let $ y_2(x) = v(x)y_1(x) $ and substitute this back to the equation, we get:

$ \begin{eqnarray*} y'' - py' - qy &=& 0 \\ (v''y_1 + 2v'y_1' + vy_1'') + p(v'y_1 + vy_1') + q(vy_1) &=& 0 \\ v''y_1 + 2v'y_1' + p(v'y_1) + vy_1'' + p(vy_1') + q(vy_1) &=& 0 \\ v''y_1 + 2v'y_1' + p(v'y_1) &=& 0 \\ \frac{v''}{v'} + 2\frac{y_1'}{y_1} + p &=& 0 \\ \frac{v''}{v'} &=& - 2\frac{y_1'}{y_1} - p \\ \log v' &=& -2 \log y_1 - \int p dx \\ v' &=& e^{-2 \log y_1 - \int p dx} \\ &=& \frac{1}{y_1^2}e^{-\int p dx} \\ v &=& \int \frac{1}{y_1^2}e^{-\int p dx} dx \end{eqnarray*} $

So we will need to do is to compute the two integral for our special problem.

$ \begin{eqnarray*} v &=& \int \frac{1}{y_1^2}e^{-\int p dx} dx \\ &=& \int \frac{1}{x^4}e^{-\int \frac{-1}{2x} dx} dx\\ &=& \int \frac{1}{x^4}e^{-(\frac{-1}{2}\log x)} dx \\ &=& \int \frac{1}{x^4}e^{\frac{1}{2}\log x} dx \\ &=& \int \frac{1}{x^4}e^{\log \sqrt{x}} dx \\ &=& \int \frac{1}{x^4}\sqrt{x} dx \\ &=& \int x^{-3.5} dx \\ &=& \frac{x^{-2.5}}{2.5} \\ y_2 &=& vy_1 \\ &=& \frac{x^{-2.5}}{2.5}x^2 \\ &=& \frac{x^{-0.5}}{2.5} \end{eqnarray*} $

As constant can be ignored, now we come back to full circle. In general, I guess the integrals are going to be hard to evaluate. This problem seems rather tailored for the purpose of practicing.

The method of variation of parameter (II)

Problem:

$ y'' - 3y' + 2y = \cos x $

Solution:

The solution to the homogeneous equation $ w'' - 3w' + 2w = 0 $ is obviously $ w_1 = e^x $ and $ w_2 = e^{2x} $.

Next, we solve the equation pair:

$ v_1' e^x + v_2' e^{2x} = 0 $.
$ v_1' e^x + 2 v_2' e^{2x} = \cos x $.

The second equation subtracts the first equation gives:

$ v_2' e^{2x} = \cos x $

Therefore $ v_2' = \cos x e^{-2x} $.

This time I do the integral myself using Euler's relation!

Consider the integral $ \int{e^{ix}e^{-2x}dx} = \int{(\cos x + i\sin x)e^{-2x}dx} $. Therefore we can equate the real part to get the result, and the first integral is particularly easy.

$ \int{e^{ix}e^{-2x}dx} = \frac{1}{-2 + i}e^{(-2 + i)x} $.

Next we find the real part of it by rationalizing and Euler's relation.

$ \begin{eqnarray*} & & \frac{1}{-2 + i}e^{(-2 + i)x} \\ &=& \frac{(-2 - i)}{(-2 + i)(-2 - i)}e^{(-2 + i)x} \\ &=& \frac{(-2 - i)}{5}e^{(-2 + i)x} \\ &=& \frac{(-2 - i)}{5}e^{-2x}e^{ix} \\ &=& \frac{(-2 - i)}{5}e^{-2x}(\cos x + i\sin x) \\ \end{eqnarray*} $

Therefore, we have

$ \begin{eqnarray*} & & v_2(x) \\ &=& \int \cos x e^{-2x} dx \\ &=& e^{-2x}(\frac{-2}{5}\cos x + \frac{1}{5}\sin x) \end{eqnarray*} $

Similarly, we solve $ v_1'(x) $ by subtracting the second equation by twice the first one, that gives $ v_1'(x) = -\cos(x)e^{-2x} $. The integral is very similar and we get $ \begin{eqnarray*} & & v_1(x) \\ &=& \int -\cos x e^{-x} dx \\ &=& e^{-x}(\frac{1}{2}\cos x - \frac{1}{2}\sin x) \end{eqnarray*} $

Therefore the answer is $ (\frac{-2}{5} + \frac{1}{2})\cos x + (\frac{1}{5} - \frac{1}{2})\sin x + Ae^x + Be^{2x} = \frac{1}{10}\cos x - \frac{3}{10}\sin x + Ae^x + Be^{2x} $.