## Day 3: Toboggan Trajectory

By Xander

problem Parsing the Input The input this time is a file consisting of ‘#’ and ‘.’ and we only need a list of each line. We can accomplish this by using the file.readlines() function. Part 1 The file above is a map of the terrain, which repeats indefinitely horizontally. The goal is to count the…

By Xander

problem Parsing the Input The input is given with each line containing a range, letter, and a password. I found the easiest way to parse the input was using regular expressions or RegEx Part 1 In part 1 we are given a character that has to be in the password between a certain amount of…

## Day 1: Report Repair

By Xander

problem The first day of the new years challenges came with a nice relaxing solution. Parsing the Input The input is given as a list of integers seperated by line breaks like the following. This can be parsed in python by reading the file, and creating a set containing the integer of each line. The…

## Integration Problem 3

By Xander

Integral taken from instagram user @integralsforyou $$\int\frac{e^{\frac{1}{x}}}{x^2}dx$$ $$=\int e^{(x^{-1})}\cdot x^{-2}dx$$ let $u=x^{-1}$ $du=-x^{-2}$ $$=-\int e^udu$$ $$=-e^u+C$$ $$=-e^{\frac{1}{x}}+C$$

## Integration problem 2

By Xander

Integral taken from instagram user @integralsforyou $$\int\tan^2(x)\cdot\sin(x)dx$$ $$=\int\frac{\sin^2(x)}{\cos^2(x)}\cdot\sin(x)dx$$ $$=\int\frac{\sin(x)\cdot(1-\cos^2(x))}{\cos^2(x)}dx$$ let $u=\cos(x)$ $du=-\sin(x)dx$ $$=-\int\frac{1-u^2}{u^2}du$$ $$=-\int(\frac{1}{u^2}-\frac{u^2}{u^2})du$$ $$=\int(1-\frac{1}{u^2})du$$ $$=u+\frac{1}{u}+C$$ $$=\cos(x)+\sec(x)+C$$

## Integration problem 1

By Xander

Integral taken from instagram user @integralsforyou $$\int\frac{x^2+a}{x^2+b^2}dx$$ $$=\int(\frac{x^2+b^2}{x^2+b^2}+\frac{a-b^2}{x^2+b^2})dx$$ $$=\int(1)dx+(a-b^2)\int\frac{1}{b^2+x^2}dx$$ $$=x+(\frac{a-b^2}{b})\arctan(\frac{x}{b})+C$$