If you want quick solution, then

Ai = - Ar + At from boundary condition related to phase angles and displacement

Z₁ Ai² = Z₁ Ar² + Z₂ At² from Energy/sec. Conservation

or k₁ Ai² = k₁ Ar² + k₂ At²

Solving them we get

Ar/Ai = (k₁ - k₂)/(k₁+k₂) and At / Ai = 2 k₁ / (k₁+k₂)

Ar/Ai = (Z₁ - Z₂)/(Z₁+Z₂) and At / Ai = 2 Z₁/ (Z₁+Z₂)

Ar/Ai = (v₂ - v₁)/(v₁+v₂) and At / Ai = 2 v₂ / (v₁+v₂)

This is the same formula for all Transverse waves, mechanical, light and electromagnetic waves too.

===============================

Transverse waves oscillate in (y) perpendicular to the direction (positive x) of propagation. X-axis is along the string. Let F be the tension force in the string at any x.

y(x, t) = Ai Sin (ω t – k₁ x) with an initial phase of 0, at t = x = 0

ω = angular freq. wavelength = λ₁, wave number = k₁ = 2π/λ₁ , T = time period

velocity in x direction = v₁ = λ₁/T k₁ = ω/v₁

let μ₁ = mass per unit length of the string. We can derive that : v₁ = √(F/ μ₁)

So F = μ₁ v₁² = v₁ Z₁, where Characteristic impedance of the string = Z₁ = μ₁ * v₁

k₁ is the wave number specific to the string and it may depend on the impedance of the string, mass per unit length and temperature. Suppose the wave encounters a heavier string of higher wave number k₂, and impedance Z₂, then most of the energy in the wave is reflected. A little is transmitted. The reflected wave has a phase difference of π with the incident wave. The transmitted wave has the same phase as the incident wave. Frequency of the wave remains same in both strings.

Let k₂, λ₂, v₂, Z₂ be the wave number, wavelength, velocity and characteristic impedance of the wave on the second string. Let both strings meet at x = L and at t = t₁.

So v₂ = √(F/ μ₂) and F = μ₂ v₂² = v₂ Z₂

Since, F = v₁ * Z₁ = v₂ *Z₂, we get * v₁ / v₂ = Z₂/Z₁ = k₂/k₁*

Yr (x, t) = Ar Sin (ω (t-t₁) - k₁ (L- x) + θ) where Ar = amplitude of reflected wave.

As the phase difference with Yi(x,t) is π at x =L and t= t₁, we get:

ω (t-t₁) - k₁(L-x) + θ = ω t₁ - k₁ L - π => θ = ω t₁ - k₁ L – π

=> Yr(x,t) = Ar Sin [ω t - k₁(L- x) + k₁ L - π]

Yt (x, t) = At Sin [ω (t-t₁) - k₂ (x-L) + Ф) , where At = amplitude of transmitted wave

as phase angle is same as Yi(x,t) at x = L and t = t₁ , we get

ω (t-t₁) - k₂ (x-L) + Ф = ω t – k₁ x => Ф = (k₂ – k₁) L

=> Yt(x, t) = At Sin [[ω t - k₂ x + (k₂ - k₁) L]

*Boundary conditions *:

1) Displacement of the initial wave is the algebraic sum of the other two displacements at the boundary of the two strings. It is like vector or phasor addition. Let δ be the phase angle of incident wave at the boundary.

Ai Sin δ = Ar Sin (δ - π) + At Sin δ

* Ai = At – Ar => Ai + Ar = At --- (1)*

2) The energy incident at the boundary (per unit time) is split into two components: reflected and transmitted. Using the conservation of energy principle, we get:

1/2 μ1 v1 ω^2 Ar^2 + 1/2 μ2 v2 ω^2 At^2 = 1/2 μ1 v1 ω^2 Ai^2

*=> * Z1 (Ai^2 – Ar^2) = Z2 At^2

=> *Z1 (Ai - Ar ) = Z2 At --- (2)*

Solving (1) and (2) we get:

Ar = (Z1 – Z2) Ai / (Z₁ + Z₂) And At = 2 Z₁ Ai /(Z₁ + Z₂ )

Or, Ar = (k₁ – k₂) Ai / (k₁ + k₂) and At = 2 k₁ Ai /(k₁ + k₂)

Or Ar = (v₂ – v₁) Ai / (v₁ + v₂) and At = 2 v₂ Ai /(v₁ + v₂)