Skip to content

Commit 8df9d1d

Browse files
Add test case for trigonometric functions fix
Added comprehensive test for Issue #20 to verify that: - sin(x) and cos(x) can be integrated with RischMethod() without errors - Results are properly computed and returned as symbolic expressions - Domain compatibility issues are resolved The test is integrated into the main test suite under the Risch method tests.
1 parent d1d5ad7 commit 8df9d1d

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Test
2+
using SymbolicIntegration
3+
using Symbolics
4+
5+
@testset "Trigonometric Functions with Risch Method" begin
6+
@variables x
7+
8+
@testset "Issue #20: Domain compatibility fix" begin
9+
# Test that trigonometric functions can be integrated with RischMethod
10+
# without throwing domain mismatch errors
11+
12+
@test_nowarn integrate(sin(x), x, RischMethod())
13+
@test_nowarn integrate(cos(x), x, RischMethod())
14+
15+
# Test that the result is computed (not just that it doesn't error)
16+
sin_result = integrate(sin(x), x, RischMethod())
17+
cos_result = integrate(cos(x), x, RischMethod())
18+
19+
# The results should not be nothing and should be symbolic expressions
20+
@test sin_result !== nothing
21+
@test cos_result !== nothing
22+
@test sin_result isa Union{Number, SymbolicUtils.BasicSymbolic}
23+
@test cos_result isa Union{Number, SymbolicUtils.BasicSymbolic}
24+
end
25+
end

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ using Symbolics
2121
# Include Risch method test suites
2222
include("methods/risch/test_rational_integration.jl")
2323
include("methods/risch/test_complex_fields.jl")
24+
include("methods/risch/test_trigonometric_functions.jl")
2425
include("methods/risch/test_bronstein_examples.jl")
2526
include("methods/risch/test_algorithm_internals.jl")
2627

0 commit comments

Comments
 (0)