# Tutor profile: Jason C.

## Questions

### Subject: Python Programming

Write a function that takes two integers and returns their greatest common divisor.

The greatest common divisor is at most the smallest of the two inputs. Therefore, we can just loop up to the minimum of the two inputs and check: $$\verb|def f(a, b):|$$ $$\verb| common_divisors = []|$$ $$\verb| for d in range(1, min(a, b) + 1):|$$ $$\verb| if a%d == 0 and b%d == 0:|$$ $$\verb| common_divisors.append(d)|$$ $$\verb| return max(common_divisors)|$$

### Subject: Pre-Calculus

Evaluate $$(1+i\sqrt 3) e^{-i \pi/3}$$.

First, we will convert $$e^{-i \pi/3}$$ to rectangular form: $( e^{-i \pi/3} = \cos (-\pi/3) + i \sin (-\pi/3) = \frac{1}{2} - \frac{\sqrt 3}{2}. $) Then, we take the product of the two terms: $(\begin{align*} (1 + i \sqrt 3) \left( \frac{1}{2} - i \frac{\sqrt 3}{2} \right) &= \left( \frac{1}{2} - i \frac{\sqrt 3}{2} \right) + i \sqrt 3 \left( \frac{1}{2} - i \frac{\sqrt 3}{2} \right) \\ &= \frac{1}{2} - i \frac{\sqrt 3}{2} + i \frac{\sqrt 3}{2} + \frac{3}{2} \\ &= 2. \end{align*}$)

### Subject: Calculus

Evaluate $( \oint_C [(x^2 - y^2)\,dx + (x^2 + y^2)\,dy], $) where $$C$$ is the boundary of the square with vertices $$(0, 0)$$, $$(1, 0)$$, $$(1, 1)$$, and $$(0, 1)$$, oriented counterclockwise

By Green's theorem, we know that the integral about the boundary of region is equal to the integral of the divergence over the region. $(\begin{align*}\oint_C [(x^2 - y^2)\,dx + (x^2 + y^2)\,dy] &= \iint_{[0, 1]^2} \left[\frac{d}{dx}(x^2 + y^2) - \frac{d}{dy}(x^2 - y^2)\right] \,dA \\ &= \int_0^1 \int_0^1 [2x + 2y] \,dx\,dy = 2.\end{align*}$)

## Contact tutor

needs and Jason will reply soon.