Using test.jl to prove trig identies

brett_knoss
Mon, 19 Oct 2020 21:25:05 +0000
General Usage

I’m trying to do a proof using trig identities, I get a fail, and I,m not sure if I’m using @test wrong, or if I made a mistake in my math s.t.

cos(x)-cos(y)=-2*(sin((x+y)/2)*sin((x-y)/2))

using Plots
using test


FX=f(x)=cos(x)
FY=f(y)=cos(y)

g(x,y)=abs(f(x)-f(y))
h(x,y)=-2*(sin((x+y)/2)*sin((x-y)/2))
delta(x,y)=abs(x-y)

plot(FX)
plot!(FY)
plot!(h)

@test h=g

plot(FX)
plot!(FY)
plot!(h)

10 posts - 4 participants